diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 17:14:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 17:14:57 -0400 |
commit | 20731945ae743034353a88c307920d1f16cf8ac8 (patch) | |
tree | 132c796fe3a167dece8cec7a40b1d5dd83a68bc8 /drivers/hwmon/w83792d.c | |
parent | 406119f49d4a6cf8b6eee639128e0575a95065e3 (diff) | |
parent | a9d1b24d91f91b77db3da8aeacb414764f789b9c (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers/hwmon/w83792d.c')
-rw-r--r-- | drivers/hwmon/w83792d.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index ba0c28015f6a..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); |
@@ -1429,7 +1427,6 @@ w83792d_write_value(struct i2c_client *client, u8 reg, u8 value) | |||
1429 | return 0; | 1427 | return 0; |
1430 | } | 1428 | } |
1431 | 1429 | ||
1432 | /* Called when we have found a new W83792D. It should set limits, etc. */ | ||
1433 | static void | 1430 | static void |
1434 | w83792d_init_client(struct i2c_client *client) | 1431 | w83792d_init_client(struct i2c_client *client) |
1435 | { | 1432 | { |