staging: Add framebuffer driver for XGI chipsets
[safe/jmp/linux-2.6] / drivers / hwmon / lm93.c
index c48a284..6669255 100644 (file)
 static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 
 /* Insmod parameters */
-I2C_CLIENT_INSMOD_1(lm93);
 
 static int disable_block;
 module_param(disable_block, bool, 0);
@@ -2501,38 +2500,27 @@ static void lm93_init_client(struct i2c_client *client)
 }
 
 /* Return 0 if detection is successful, -ENODEV otherwise */
-static int lm93_detect(struct i2c_client *client, int kind,
-                      struct i2c_board_info *info)
+static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
 {
        struct i2c_adapter *adapter = client->adapter;
+       int mfr, ver;
 
        if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
                return -ENODEV;
 
        /* detection */
-       if (kind < 0) {
-               int mfr = lm93_read_byte(client, LM93_REG_MFR_ID);
-
-               if (mfr != 0x01) {
-                       dev_dbg(&adapter->dev,"detect failed, "
-                               "bad manufacturer id 0x%02x!\n", mfr);
-                       return -ENODEV;
-               }
+       mfr = lm93_read_byte(client, LM93_REG_MFR_ID);
+       if (mfr != 0x01) {
+               dev_dbg(&adapter->dev,
+                       "detect failed, bad manufacturer id 0x%02x!\n", mfr);
+               return -ENODEV;
        }
 
-       if (kind <= 0) {
-               int ver = lm93_read_byte(client, LM93_REG_VER);
-
-               if ((ver == LM93_MFR_ID) || (ver == LM93_MFR_ID_PROTOTYPE)) {
-                       kind = lm93;
-               } else {
-                       dev_dbg(&adapter->dev,"detect failed, "
-                               "bad version id 0x%02x!\n", ver);
-                       if (kind == 0)
-                               dev_dbg(&adapter->dev,
-                                       "(ignored 'force' parameter)\n");
-                       return -ENODEV;
-               }
+       ver = lm93_read_byte(client, LM93_REG_VER);
+       if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) {
+               dev_dbg(&adapter->dev,
+                       "detect failed, bad version id 0x%02x!\n", ver);
+               return -ENODEV;
        }
 
        strlcpy(info->type, "lm93", I2C_NAME_SIZE);
@@ -2613,7 +2601,7 @@ static int lm93_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id lm93_id[] = {
-       { "lm93", lm93 },
+       { "lm93", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, lm93_id);
@@ -2627,7 +2615,7 @@ static struct i2c_driver lm93_driver = {
        .remove         = lm93_remove,
        .id_table       = lm93_id,
        .detect         = lm93_detect,
-       .address_data   = &addr_data,
+       .address_list   = normal_i2c,
 };
 
 static int __init lm93_init(void)