X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fadm1021.c;h=8102876c7c3f2cf69e9145ca3b1f3241ff487678;hb=6fe8f479d02e47c80f816b2b9f5d3996ebfe6af6;hp=a483d96e4cefb5379568d11db1ea3076e06cb375;hpb=943b0830cebe4711354945ed3cb44e84152aaca0;p=karo-tx-linux.git diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c index a483d96e4cef..8102876c7c3f 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -34,10 +33,9 @@ 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_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066); +I2C_CLIENT_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066); /* adm1021 constants specified below */ @@ -123,7 +121,7 @@ static int adm1021_write_value(struct i2c_client *client, u8 reg, static struct adm1021_data *adm1021_update_device(struct device *dev); /* (amalysh) read only mode, otherwise any limit's writing confuse BIOS */ -static int read_only = 0; +static int read_only; /* This is the driver that will be inserted */ @@ -188,7 +186,7 @@ static int adm1021_attach_adapter(struct i2c_adapter *adapter) { if (!(adapter->class & I2C_CLASS_HWMON)) return 0; - return i2c_detect(adapter, &addr_data, adm1021_detect); + return i2c_probe(adapter, &addr_data, adm1021_detect); } static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind) @@ -199,15 +197,6 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind) int err = 0; const char *type_name = ""; - /* Make sure we aren't probing the ISA bus!! This is just a safety check - at this moment; i2c_detect really won't call us. */ -#ifdef DEBUG - if (i2c_is_isa_adapter(adapter)) { - dev_dbg(&adapter->dev, "adm1021_detect called for an ISA bus adapter?!?\n"); - return 0; - } -#endif - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) goto error0; @@ -215,11 +204,10 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind) client structure, even though we cannot fill it completely yet. But it allows us to access adm1021_{read,write}_value. */ - if (!(data = kmalloc(sizeof(struct adm1021_data), GFP_KERNEL))) { + if (!(data = kzalloc(sizeof(struct adm1021_data), GFP_KERNEL))) { err = -ENOMEM; goto error0; } - memset(data, 0, sizeof(struct adm1021_data)); new_client = &data->client; i2c_set_clientdata(new_client, data); @@ -338,10 +326,8 @@ static int adm1021_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;