X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fmax1619.c;h=6a82ffae1bfd6af15ce3fb89c92cae3c62edaab7;hb=c1d962035d49565d8c7a2d97519012ccb861778a;hp=56c34c2d3619312b269310027acc18aff37be304;hpb=943b0830cebe4711354945ed3cb44e84152aaca0;p=powerpc.git diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index 56c34c2d36..6a82ffae1b 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -39,13 +38,12 @@ static unsigned short normal_i2c[] = { 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; /* * Insmod parameters */ -SENSORS_INSMOD_1(max1619); +I2C_CLIENT_INSMOD_1(max1619); /* * The MAX1619 registers @@ -181,7 +179,7 @@ static int max1619_attach_adapter(struct i2c_adapter *adapter) { if (!(adapter->class & I2C_CLASS_HWMON)) return 0; - return i2c_detect(adapter, &addr_data, max1619_detect); + return i2c_probe(adapter, &addr_data, max1619_detect); } /* @@ -199,11 +197,10 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) goto exit; - if (!(data = kmalloc(sizeof(struct max1619_data), GFP_KERNEL))) { + if (!(data = kzalloc(sizeof(struct max1619_data), GFP_KERNEL))) { err = -ENOMEM; goto exit; } - memset(data, 0, sizeof(struct max1619_data)); /* The common I2C client data is placed right before the MAX1619-specific data. */ @@ -323,11 +320,8 @@ static int max1619_detach_client(struct i2c_client *client) hwmon_device_unregister(data->class_dev); - if ((err = i2c_detach_client(client))) { - dev_err(&client->dev, "Client deregistration failed, " - "client not detached.\n"); + if ((err = i2c_detach_client(client))) return err; - } kfree(data); return 0;