diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 12:50:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 12:50:54 -0500 |
commit | 522a99140ff4794ddd168568c583fea1c8f75397 (patch) | |
tree | 66c9fda77bbe42e581bf9af9a88a5a611cd665ab | |
parent | 8a9f772c14f85e2a580baadc50c194835da2d4e5 (diff) | |
parent | 4f5b7994f0610fefff0782227ab71469ece54a5b (diff) |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
hwmon: (gpio-fan) Fix fan_ctrl_init error path
hwmon: (ad7414) Return proper error code for ad7414_probe()
hwmon: (adt7470) Return proper error code for adt7470_probe()
-rw-r--r-- | drivers/hwmon/ad7414.c | 6 | ||||
-rw-r--r-- | drivers/hwmon/adt7470.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/gpio-fan.c | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c index 1e4c21fc1a89..86d822aa9bbf 100644 --- a/drivers/hwmon/ad7414.c +++ b/drivers/hwmon/ad7414.c | |||
@@ -178,11 +178,13 @@ static int ad7414_probe(struct i2c_client *client, | |||
178 | { | 178 | { |
179 | struct ad7414_data *data; | 179 | struct ad7414_data *data; |
180 | int conf; | 180 | int conf; |
181 | int err = 0; | 181 | int err; |
182 | 182 | ||
183 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA | | 183 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA | |
184 | I2C_FUNC_SMBUS_READ_WORD_DATA)) | 184 | I2C_FUNC_SMBUS_READ_WORD_DATA)) { |
185 | err = -EOPNOTSUPP; | ||
185 | goto exit; | 186 | goto exit; |
187 | } | ||
186 | 188 | ||
187 | data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL); | 189 | data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL); |
188 | if (!data) { | 190 | if (!data) { |
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index 9e775717abb7..87d92a56a939 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c | |||
@@ -1286,8 +1286,10 @@ static int adt7470_probe(struct i2c_client *client, | |||
1286 | init_completion(&data->auto_update_stop); | 1286 | init_completion(&data->auto_update_stop); |
1287 | data->auto_update = kthread_run(adt7470_update_thread, client, | 1287 | data->auto_update = kthread_run(adt7470_update_thread, client, |
1288 | dev_name(data->hwmon_dev)); | 1288 | dev_name(data->hwmon_dev)); |
1289 | if (IS_ERR(data->auto_update)) | 1289 | if (IS_ERR(data->auto_update)) { |
1290 | err = PTR_ERR(data->auto_update); | ||
1290 | goto exit_unregister; | 1291 | goto exit_unregister; |
1292 | } | ||
1291 | 1293 | ||
1292 | return 0; | 1294 | return 0; |
1293 | 1295 | ||
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index aa701a183707..f141a1de519c 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c | |||
@@ -376,10 +376,6 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data, | |||
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
379 | err = sysfs_create_group(&pdev->dev.kobj, &gpio_fan_ctrl_group); | ||
380 | if (err) | ||
381 | goto err_free_gpio; | ||
382 | |||
383 | fan_data->num_ctrl = num_ctrl; | 379 | fan_data->num_ctrl = num_ctrl; |
384 | fan_data->ctrl = ctrl; | 380 | fan_data->ctrl = ctrl; |
385 | fan_data->num_speed = pdata->num_speed; | 381 | fan_data->num_speed = pdata->num_speed; |
@@ -391,6 +387,10 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data, | |||
391 | goto err_free_gpio; | 387 | goto err_free_gpio; |
392 | } | 388 | } |
393 | 389 | ||
390 | err = sysfs_create_group(&pdev->dev.kobj, &gpio_fan_ctrl_group); | ||
391 | if (err) | ||
392 | goto err_free_gpio; | ||
393 | |||
394 | return 0; | 394 | return 0; |
395 | 395 | ||
396 | err_free_gpio: | 396 | err_free_gpio: |