aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83781d.c
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@plexity.net>2005-10-17 17:08:32 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 17:02:12 -0400
commitba9c2e8d15da029ea3051c95e446b2d638ef02e2 (patch)
tree28272b92080f18f16008c09464190939183c8698 /drivers/hwmon/w83781d.c
parent2286066faf51890e49ad61e2ceab683666cd9108 (diff)
[PATCH] hwmon: kzalloc conversion
Use kzalloc instead of kmalloc+memset in all hardware monitoring drivers. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon/w83781d.c')
-rw-r--r--drivers/hwmon/w83781d.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 26b1fac7c619..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);