diff options
Diffstat (limited to 'drivers/hwmon/lm93.c')
-rw-r--r-- | drivers/hwmon/lm93.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index fc36cadf36fb..6669255aadcf 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c | |||
@@ -145,7 +145,6 @@ | |||
145 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | 145 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; |
146 | 146 | ||
147 | /* Insmod parameters */ | 147 | /* Insmod parameters */ |
148 | I2C_CLIENT_INSMOD_1(lm93); | ||
149 | 148 | ||
150 | static int disable_block; | 149 | static int disable_block; |
151 | module_param(disable_block, bool, 0); | 150 | module_param(disable_block, bool, 0); |
@@ -928,7 +927,7 @@ static void lm93_update_client_common(struct lm93_data *data, | |||
928 | data->prochot_interval = lm93_read_byte(client, | 927 | data->prochot_interval = lm93_read_byte(client, |
929 | LM93_REG_PROCHOT_INTERVAL); | 928 | LM93_REG_PROCHOT_INTERVAL); |
930 | 929 | ||
931 | /* Fan Boost Termperature registers */ | 930 | /* Fan Boost Temperature registers */ |
932 | for (i = 0; i < 4; i++) | 931 | for (i = 0; i < 4; i++) |
933 | data->boost[i] = lm93_read_byte(client, LM93_REG_BOOST(i)); | 932 | data->boost[i] = lm93_read_byte(client, LM93_REG_BOOST(i)); |
934 | 933 | ||
@@ -2501,38 +2500,27 @@ static void lm93_init_client(struct i2c_client *client) | |||
2501 | } | 2500 | } |
2502 | 2501 | ||
2503 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 2502 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
2504 | static int lm93_detect(struct i2c_client *client, int kind, | 2503 | static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info) |
2505 | struct i2c_board_info *info) | ||
2506 | { | 2504 | { |
2507 | struct i2c_adapter *adapter = client->adapter; | 2505 | struct i2c_adapter *adapter = client->adapter; |
2506 | int mfr, ver; | ||
2508 | 2507 | ||
2509 | if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) | 2508 | if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) |
2510 | return -ENODEV; | 2509 | return -ENODEV; |
2511 | 2510 | ||
2512 | /* detection */ | 2511 | /* detection */ |
2513 | if (kind < 0) { | 2512 | mfr = lm93_read_byte(client, LM93_REG_MFR_ID); |
2514 | int mfr = lm93_read_byte(client, LM93_REG_MFR_ID); | 2513 | if (mfr != 0x01) { |
2515 | 2514 | dev_dbg(&adapter->dev, | |
2516 | if (mfr != 0x01) { | 2515 | "detect failed, bad manufacturer id 0x%02x!\n", mfr); |
2517 | dev_dbg(&adapter->dev,"detect failed, " | 2516 | return -ENODEV; |
2518 | "bad manufacturer id 0x%02x!\n", mfr); | ||
2519 | return -ENODEV; | ||
2520 | } | ||
2521 | } | 2517 | } |
2522 | 2518 | ||
2523 | if (kind <= 0) { | 2519 | ver = lm93_read_byte(client, LM93_REG_VER); |
2524 | int ver = lm93_read_byte(client, LM93_REG_VER); | 2520 | if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) { |
2525 | 2521 | dev_dbg(&adapter->dev, | |
2526 | if ((ver == LM93_MFR_ID) || (ver == LM93_MFR_ID_PROTOTYPE)) { | 2522 | "detect failed, bad version id 0x%02x!\n", ver); |
2527 | kind = lm93; | 2523 | return -ENODEV; |
2528 | } else { | ||
2529 | dev_dbg(&adapter->dev,"detect failed, " | ||
2530 | "bad version id 0x%02x!\n", ver); | ||
2531 | if (kind == 0) | ||
2532 | dev_dbg(&adapter->dev, | ||
2533 | "(ignored 'force' parameter)\n"); | ||
2534 | return -ENODEV; | ||
2535 | } | ||
2536 | } | 2524 | } |
2537 | 2525 | ||
2538 | strlcpy(info->type, "lm93", I2C_NAME_SIZE); | 2526 | strlcpy(info->type, "lm93", I2C_NAME_SIZE); |
@@ -2613,7 +2601,7 @@ static int lm93_remove(struct i2c_client *client) | |||
2613 | } | 2601 | } |
2614 | 2602 | ||
2615 | static const struct i2c_device_id lm93_id[] = { | 2603 | static const struct i2c_device_id lm93_id[] = { |
2616 | { "lm93", lm93 }, | 2604 | { "lm93", 0 }, |
2617 | { } | 2605 | { } |
2618 | }; | 2606 | }; |
2619 | MODULE_DEVICE_TABLE(i2c, lm93_id); | 2607 | MODULE_DEVICE_TABLE(i2c, lm93_id); |
@@ -2627,7 +2615,7 @@ static struct i2c_driver lm93_driver = { | |||
2627 | .remove = lm93_remove, | 2615 | .remove = lm93_remove, |
2628 | .id_table = lm93_id, | 2616 | .id_table = lm93_id, |
2629 | .detect = lm93_detect, | 2617 | .detect = lm93_detect, |
2630 | .address_data = &addr_data, | 2618 | .address_list = normal_i2c, |
2631 | }; | 2619 | }; |
2632 | 2620 | ||
2633 | static int __init lm93_init(void) | 2621 | static int __init lm93_init(void) |