diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/hwmon.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/max1619.c | 14 | ||||
-rw-r--r-- | drivers/hwmon/w83781d.c | 6 |
3 files changed, 9 insertions, 12 deletions
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 6f48579799b5..dddd3eb9b387 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kdev_t.h> | 16 | #include <linux/kdev_t.h> |
17 | #include <linux/idr.h> | 17 | #include <linux/idr.h> |
18 | #include <linux/hwmon.h> | 18 | #include <linux/hwmon.h> |
19 | #include <linux/gfp.h> | ||
19 | 20 | ||
20 | #define HWMON_ID_PREFIX "hwmon" | 21 | #define HWMON_ID_PREFIX "hwmon" |
21 | #define HWMON_ID_FORMAT HWMON_ID_PREFIX "%d" | 22 | #define HWMON_ID_FORMAT HWMON_ID_PREFIX "%d" |
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index 6a82ffae1bfd..69e7e125683b 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c | |||
@@ -193,7 +193,7 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) | |||
193 | int err = 0; | 193 | int err = 0; |
194 | const char *name = ""; | 194 | const char *name = ""; |
195 | u8 reg_config=0, reg_convrate=0, reg_status=0; | 195 | u8 reg_config=0, reg_convrate=0, reg_status=0; |
196 | u8 man_id, chip_id; | 196 | |
197 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 197 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
198 | goto exit; | 198 | goto exit; |
199 | 199 | ||
@@ -238,16 +238,15 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) | |||
238 | } | 238 | } |
239 | 239 | ||
240 | if (kind <= 0) { /* identification */ | 240 | if (kind <= 0) { /* identification */ |
241 | u8 man_id, chip_id; | ||
241 | 242 | ||
242 | man_id = i2c_smbus_read_byte_data(new_client, | 243 | man_id = i2c_smbus_read_byte_data(new_client, |
243 | MAX1619_REG_R_MAN_ID); | 244 | MAX1619_REG_R_MAN_ID); |
244 | chip_id = i2c_smbus_read_byte_data(new_client, | 245 | chip_id = i2c_smbus_read_byte_data(new_client, |
245 | MAX1619_REG_R_CHIP_ID); | 246 | MAX1619_REG_R_CHIP_ID); |
246 | 247 | ||
247 | if ((man_id == 0x4D) && (chip_id == 0x04)){ | 248 | if ((man_id == 0x4D) && (chip_id == 0x04)) |
248 | kind = max1619; | 249 | kind = max1619; |
249 | } | ||
250 | } | ||
251 | 250 | ||
252 | if (kind <= 0) { /* identification failed */ | 251 | if (kind <= 0) { /* identification failed */ |
253 | dev_info(&adapter->dev, | 252 | dev_info(&adapter->dev, |
@@ -255,11 +254,10 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) | |||
255 | "chip_id=0x%02X).\n", man_id, chip_id); | 254 | "chip_id=0x%02X).\n", man_id, chip_id); |
256 | goto exit_free; | 255 | goto exit_free; |
257 | } | 256 | } |
258 | 257 | } | |
259 | 258 | ||
260 | if (kind == max1619){ | 259 | if (kind == max1619) |
261 | name = "max1619"; | 260 | name = "max1619"; |
262 | } | ||
263 | 261 | ||
264 | /* We can fill in the remaining client fields */ | 262 | /* We can fill in the remaining client fields */ |
265 | strlcpy(new_client->name, name, I2C_NAME_SIZE); | 263 | strlcpy(new_client->name, name, I2C_NAME_SIZE); |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 9265f32122fa..ffdb3a03e2b5 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -976,11 +976,9 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind, | |||
976 | ERROR_SC_3: | 976 | ERROR_SC_3: |
977 | i2c_detach_client(data->lm75[0]); | 977 | i2c_detach_client(data->lm75[0]); |
978 | ERROR_SC_2: | 978 | ERROR_SC_2: |
979 | if (data->lm75[1]) | 979 | kfree(data->lm75[1]); |
980 | kfree(data->lm75[1]); | ||
981 | ERROR_SC_1: | 980 | ERROR_SC_1: |
982 | if (data->lm75[0]) | 981 | kfree(data->lm75[0]); |
983 | kfree(data->lm75[0]); | ||
984 | ERROR_SC_0: | 982 | ERROR_SC_0: |
985 | return err; | 983 | return err; |
986 | } | 984 | } |