diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2005-10-17 17:08:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 17:02:12 -0400 |
commit | ba9c2e8d15da029ea3051c95e446b2d638ef02e2 (patch) | |
tree | 28272b92080f18f16008c09464190939183c8698 /drivers/hwmon/w83792d.c | |
parent | 2286066faf51890e49ad61e2ceab683666cd9108 (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/w83792d.c')
-rw-r--r-- | drivers/hwmon/w83792d.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index 7bbd1888ce94..4be59dbb78c4 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c | |||
@@ -1086,11 +1086,10 @@ w83792d_create_subclient(struct i2c_adapter *adapter, | |||
1086 | int err; | 1086 | int err; |
1087 | struct i2c_client *sub_client; | 1087 | struct i2c_client *sub_client; |
1088 | 1088 | ||
1089 | (*sub_cli) = sub_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 1089 | (*sub_cli) = sub_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
1090 | if (!(sub_client)) { | 1090 | if (!(sub_client)) { |
1091 | return -ENOMEM; | 1091 | return -ENOMEM; |
1092 | } | 1092 | } |
1093 | memset(sub_client, 0x00, sizeof(struct i2c_client)); | ||
1094 | sub_client->addr = 0x48 + addr; | 1093 | sub_client->addr = 0x48 + addr; |
1095 | i2c_set_clientdata(sub_client, NULL); | 1094 | i2c_set_clientdata(sub_client, NULL); |
1096 | sub_client->adapter = adapter; | 1095 | sub_client->adapter = adapter; |
@@ -1184,11 +1183,10 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1184 | client structure, even though we cannot fill it completely yet. | 1183 | client structure, even though we cannot fill it completely yet. |
1185 | But it allows us to access w83792d_{read,write}_value. */ | 1184 | But it allows us to access w83792d_{read,write}_value. */ |
1186 | 1185 | ||
1187 | if (!(data = kmalloc(sizeof(struct w83792d_data), GFP_KERNEL))) { | 1186 | if (!(data = kzalloc(sizeof(struct w83792d_data), GFP_KERNEL))) { |
1188 | err = -ENOMEM; | 1187 | err = -ENOMEM; |
1189 | goto ERROR0; | 1188 | goto ERROR0; |
1190 | } | 1189 | } |
1191 | memset(data, 0, sizeof(struct w83792d_data)); | ||
1192 | 1190 | ||
1193 | new_client = &data->client; | 1191 | new_client = &data->client; |
1194 | i2c_set_clientdata(new_client, data); | 1192 | i2c_set_clientdata(new_client, data); |