diff options
Diffstat (limited to 'drivers/hwmon/w83781d.c')
-rw-r--r-- | drivers/hwmon/w83781d.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 4c43337ca780..9265f32122fa 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -889,12 +889,11 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind, | |||
889 | const char *client_name = ""; | 889 | const char *client_name = ""; |
890 | struct w83781d_data *data = i2c_get_clientdata(new_client); | 890 | struct w83781d_data *data = i2c_get_clientdata(new_client); |
891 | 891 | ||
892 | data->lm75[0] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 892 | data->lm75[0] = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
893 | if (!(data->lm75[0])) { | 893 | if (!(data->lm75[0])) { |
894 | err = -ENOMEM; | 894 | err = -ENOMEM; |
895 | goto ERROR_SC_0; | 895 | goto ERROR_SC_0; |
896 | } | 896 | } |
897 | memset(data->lm75[0], 0x00, sizeof (struct i2c_client)); | ||
898 | 897 | ||
899 | id = i2c_adapter_id(adapter); | 898 | id = i2c_adapter_id(adapter); |
900 | 899 | ||
@@ -919,13 +918,11 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind, | |||
919 | } | 918 | } |
920 | 919 | ||
921 | if (kind != w83783s) { | 920 | if (kind != w83783s) { |
922 | 921 | data->lm75[1] = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | |
923 | data->lm75[1] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | ||
924 | if (!(data->lm75[1])) { | 922 | if (!(data->lm75[1])) { |
925 | err = -ENOMEM; | 923 | err = -ENOMEM; |
926 | goto ERROR_SC_1; | 924 | goto ERROR_SC_1; |
927 | } | 925 | } |
928 | memset(data->lm75[1], 0x0, sizeof(struct i2c_client)); | ||
929 | 926 | ||
930 | if (force_subclients[0] == id && | 927 | if (force_subclients[0] == id && |
931 | force_subclients[1] == address) { | 928 | force_subclients[1] == address) { |
@@ -1064,11 +1061,10 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1064 | client structure, even though we cannot fill it completely yet. | 1061 | client structure, even though we cannot fill it completely yet. |
1065 | But it allows us to access w83781d_{read,write}_value. */ | 1062 | But it allows us to access w83781d_{read,write}_value. */ |
1066 | 1063 | ||
1067 | if (!(data = kmalloc(sizeof(struct w83781d_data), GFP_KERNEL))) { | 1064 | if (!(data = kzalloc(sizeof(struct w83781d_data), GFP_KERNEL))) { |
1068 | err = -ENOMEM; | 1065 | err = -ENOMEM; |
1069 | goto ERROR1; | 1066 | goto ERROR1; |
1070 | } | 1067 | } |
1071 | memset(data, 0, sizeof(struct w83781d_data)); | ||
1072 | 1068 | ||
1073 | new_client = &data->client; | 1069 | new_client = &data->client; |
1074 | i2c_set_clientdata(new_client, data); | 1070 | i2c_set_clientdata(new_client, data); |
@@ -1451,7 +1447,6 @@ w83781d_write_value(struct i2c_client *client, u16 reg, u16 value) | |||
1451 | return 0; | 1447 | return 0; |
1452 | } | 1448 | } |
1453 | 1449 | ||
1454 | /* Called when we have found a new W83781D. It should set limits, etc. */ | ||
1455 | static void | 1450 | static void |
1456 | w83781d_init_client(struct i2c_client *client) | 1451 | w83781d_init_client(struct i2c_client *client) |
1457 | { | 1452 | { |