- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / hwmon / lm63.c
index 3195a26..bf81aff 100644 (file)
 static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END };
 
 /*
- * Insmod parameters
- */
-
-I2C_CLIENT_INSMOD_1(lm63);
-
-/*
  * The LM63 registers
  */
 
@@ -134,8 +128,7 @@ static int lm63_remove(struct i2c_client *client);
 
 static struct lm63_data *lm63_update_device(struct device *dev);
 
-static int lm63_detect(struct i2c_client *client, int kind,
-                      struct i2c_board_info *info);
+static int lm63_detect(struct i2c_client *client, struct i2c_board_info *info);
 static void lm63_init_client(struct i2c_client *client);
 
 /*
@@ -143,7 +136,7 @@ static void lm63_init_client(struct i2c_client *client);
  */
 
 static const struct i2c_device_id lm63_id[] = {
-       { "lm63", lm63 },
+       { "lm63", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, lm63_id);
@@ -157,7 +150,7 @@ static struct i2c_driver lm63_driver = {
        .remove         = lm63_remove,
        .id_table       = lm63_id,
        .detect         = lm63_detect,
-       .address_data   = &addr_data,
+       .address_list   = normal_i2c,
 };
 
 /*
@@ -423,44 +416,38 @@ static const struct attribute_group lm63_group_fan1 = {
  */
 
 /* Return 0 if detection is successful, -ENODEV otherwise */
-static int lm63_detect(struct i2c_client *new_client, int kind,
+static int lm63_detect(struct i2c_client *new_client,
                       struct i2c_board_info *info)
 {
        struct i2c_adapter *adapter = new_client->adapter;
+       u8 man_id, chip_id, reg_config1, reg_config2;
+       u8 reg_alert_status, reg_alert_mask;
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return -ENODEV;
 
-       if (kind < 0) { /* must identify */
-               u8 man_id, chip_id, reg_config1, reg_config2;
-               u8 reg_alert_status, reg_alert_mask;
-
-               man_id = i2c_smbus_read_byte_data(new_client,
-                        LM63_REG_MAN_ID);
-               chip_id = i2c_smbus_read_byte_data(new_client,
-                         LM63_REG_CHIP_ID);
-               reg_config1 = i2c_smbus_read_byte_data(new_client,
-                             LM63_REG_CONFIG1);
-               reg_config2 = i2c_smbus_read_byte_data(new_client,
-                             LM63_REG_CONFIG2);
-               reg_alert_status = i2c_smbus_read_byte_data(new_client,
-                                  LM63_REG_ALERT_STATUS);
-               reg_alert_mask = i2c_smbus_read_byte_data(new_client,
-                                LM63_REG_ALERT_MASK);
-
-               if (man_id == 0x01 /* National Semiconductor */
-                && chip_id == 0x41 /* LM63 */
-                && (reg_config1 & 0x18) == 0x00
-                && (reg_config2 & 0xF8) == 0x00
-                && (reg_alert_status & 0x20) == 0x00
-                && (reg_alert_mask & 0xA4) == 0xA4) {
-                       kind = lm63;
-               } else { /* failed */
-                       dev_dbg(&adapter->dev, "Unsupported chip "
-                               "(man_id=0x%02X, chip_id=0x%02X).\n",
-                               man_id, chip_id);
-                       return -ENODEV;
-               }
+       man_id = i2c_smbus_read_byte_data(new_client, LM63_REG_MAN_ID);
+       chip_id = i2c_smbus_read_byte_data(new_client, LM63_REG_CHIP_ID);
+
+       reg_config1 = i2c_smbus_read_byte_data(new_client,
+                     LM63_REG_CONFIG1);
+       reg_config2 = i2c_smbus_read_byte_data(new_client,
+                     LM63_REG_CONFIG2);
+       reg_alert_status = i2c_smbus_read_byte_data(new_client,
+                          LM63_REG_ALERT_STATUS);
+       reg_alert_mask = i2c_smbus_read_byte_data(new_client,
+                        LM63_REG_ALERT_MASK);
+
+       if (man_id != 0x01 /* National Semiconductor */
+        || chip_id != 0x41 /* LM63 */
+        || (reg_config1 & 0x18) != 0x00
+        || (reg_config2 & 0xF8) != 0x00
+        || (reg_alert_status & 0x20) != 0x00
+        || (reg_alert_mask & 0xA4) != 0xA4) {
+               dev_dbg(&adapter->dev,
+                       "Unsupported chip (man_id=0x%02X, chip_id=0x%02X)\n",
+                       man_id, chip_id);
+               return -ENODEV;
        }
 
        strlcpy(info->type, "lm63", I2C_NAME_SIZE);