X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fhwmon%2Flm75.c;h=74ca2c8c61c3ae4996a46bcf523dba87b26f2561;hb=b4669d66fb1488fd9cebe0b8da447cfeb86109ba;hp=54dda7d11ace7b442a2395dac495ad2f4d1616ee;hpb=5071860aba7fc69279ab822638ed2c2e4549f9fd;p=linux-2.6-omap-h63xx.git diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 54dda7d11ac..74ca2c8c61c 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include "lm75.h" @@ -34,7 +33,7 @@ static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; /* Insmod parameters */ -SENSORS_INSMOD_1(lm75); +I2C_CLIENT_INSMOD_1(lm75); /* Many LM75 constants specified below */ @@ -67,10 +66,10 @@ static struct lm75_data *lm75_update_device(struct device *dev); /* This is the driver that will be inserted */ static struct i2c_driver lm75_driver = { - .owner = THIS_MODULE, - .name = "lm75", + .driver = { + .name = "lm75", + }, .id = I2C_DRIVERID_LM75, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm75_attach_adapter, .detach_client = lm75_detach_client, }; @@ -109,10 +108,10 @@ static int lm75_attach_adapter(struct i2c_adapter *adapter) { if (!(adapter->class & I2C_CLASS_HWMON)) return 0; - return i2c_detect(adapter, &addr_data, lm75_detect); + return i2c_probe(adapter, &addr_data, lm75_detect); } -/* This function is called by i2c_detect */ +/* This function is called by i2c_probe */ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind) { int i; @@ -121,16 +120,6 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind) int err = 0; const char *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, - "lm75_detect called for an ISA bus adapter?!?\n"); - goto exit; - } -#endif - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) goto exit; @@ -138,11 +127,10 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind) /* OK. For now, we presume we have a valid client. We now create the client structure, even though we cannot fill it completely yet. But it allows us to access lm75_{read,write}_value. */ - if (!(data = kmalloc(sizeof(struct lm75_data), GFP_KERNEL))) { + if (!(data = kzalloc(sizeof(struct lm75_data), GFP_KERNEL))) { err = -ENOMEM; goto exit; } - memset(data, 0, sizeof(struct lm75_data)); new_client = &data->client; i2c_set_clientdata(new_client, data);