mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-11 18:26:02 +00:00
hwmon: Avoid initializing the same field twice
All hwmon drivers allocate their data structure with some form of kzalloc, so setting data fields to zero explicitly is a waste of time. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
5b58157598
commit
6cf0a91ebe
@ -1115,7 +1115,6 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Initialize the asc7621 chip */
|
/* Initialize the asc7621 chip */
|
||||||
|
@ -353,8 +353,6 @@ static int atxp1_probe(struct i2c_client *new_client,
|
|||||||
data->vrm = vid_which_vrm();
|
data->vrm = vid_which_vrm();
|
||||||
|
|
||||||
i2c_set_clientdata(new_client, data);
|
i2c_set_clientdata(new_client, data);
|
||||||
data->valid = 0;
|
|
||||||
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Register sysfs hooks */
|
/* Register sysfs hooks */
|
||||||
|
@ -348,7 +348,6 @@ static int lm77_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Initialize the LM77 chip */
|
/* Initialize the LM77 chip */
|
||||||
|
@ -349,7 +349,6 @@ static int lm83_probe(struct i2c_client *new_client,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(new_client, data);
|
i2c_set_clientdata(new_client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -903,7 +903,6 @@ static int lm87_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Initialize the LM87 chip */
|
/* Initialize the LM87 chip */
|
||||||
|
@ -380,7 +380,6 @@ static int lm92_probe(struct i2c_client *new_client,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(new_client, data);
|
i2c_set_clientdata(new_client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Initialize the chipset */
|
/* Initialize the chipset */
|
||||||
|
@ -2754,7 +2754,6 @@ static int lm93_probe(struct i2c_client *client,
|
|||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
|
|
||||||
/* housekeeping */
|
/* housekeeping */
|
||||||
data->valid = 0;
|
|
||||||
data->update = update;
|
data->update = update;
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
|
@ -273,7 +273,6 @@ static int max1619_probe(struct i2c_client *new_client,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(new_client, data);
|
i2c_set_clientdata(new_client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Initialize the MAX1619 chip */
|
/* Initialize the MAX1619 chip */
|
||||||
|
@ -1376,7 +1376,6 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
err = w83792d_detect_subclients(client);
|
err = w83792d_detect_subclients(client);
|
||||||
|
@ -188,12 +188,8 @@ static int w83l785ts_probe(struct i2c_client *client,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
data->valid = 0;
|
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/* Default values in case the first read fails (unlikely). */
|
|
||||||
data->temp[1] = data->temp[0] = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the W83L785TS chip
|
* Initialize the W83L785TS chip
|
||||||
* Nothing yet, assume it is already started.
|
* Nothing yet, assume it is already started.
|
||||||
|
Loading…
Reference in New Issue
Block a user