diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 21:32:01 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 21:32:01 -0400 |
commit | 5615ca7906aefbdc3318604c89db5931d0a25910 (patch) | |
tree | c34bcc7e314f49005ad88ac84c908128729c0329 /drivers/hwmon/atxp1.c | |
parent | 7a9f8f93d2dad38f30fbc79d8a1e6517373aa4b6 (diff) | |
parent | 9dfb7808fb05643b0d06df7411b94d9546696bf1 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'drivers/hwmon/atxp1.c')
-rw-r--r-- | drivers/hwmon/atxp1.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index deb4d34c9539..53324f56404e 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c | |||
@@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IWUSR, atxp1_showgpio2, atxp1_storegpio2); | |||
253 | 253 | ||
254 | static int atxp1_attach_adapter(struct i2c_adapter *adapter) | 254 | static int atxp1_attach_adapter(struct i2c_adapter *adapter) |
255 | { | 255 | { |
256 | if (!(adapter->class & I2C_CLASS_HWMON)) | ||
257 | return 0; | ||
256 | return i2c_probe(adapter, &addr_data, &atxp1_detect); | 258 | return i2c_probe(adapter, &addr_data, &atxp1_detect); |
257 | }; | 259 | }; |
258 | 260 | ||
@@ -266,12 +268,11 @@ static int atxp1_detect(struct i2c_adapter *adapter, int address, int kind) | |||
266 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 268 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
267 | goto exit; | 269 | goto exit; |
268 | 270 | ||
269 | if (!(data = kmalloc(sizeof(struct atxp1_data), GFP_KERNEL))) { | 271 | if (!(data = kzalloc(sizeof(struct atxp1_data), GFP_KERNEL))) { |
270 | err = -ENOMEM; | 272 | err = -ENOMEM; |
271 | goto exit; | 273 | goto exit; |
272 | } | 274 | } |
273 | 275 | ||
274 | memset(data, 0, sizeof(struct atxp1_data)); | ||
275 | new_client = &data->client; | 276 | new_client = &data->client; |
276 | i2c_set_clientdata(new_client, data); | 277 | i2c_set_clientdata(new_client, data); |
277 | 278 | ||