Skip to content

Commit

Permalink
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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()
  • Loading branch information
Linus Torvalds committed Nov 12, 2010
2 parents 8a9f772 + 4f5b799 commit 522a991
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions drivers/hwmon/ad7414.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ static int ad7414_probe(struct i2c_client *client,
{
struct ad7414_data *data;
int conf;
int err = 0;
int err;

if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
I2C_FUNC_SMBUS_READ_WORD_DATA))
I2C_FUNC_SMBUS_READ_WORD_DATA)) {
err = -EOPNOTSUPP;
goto exit;
}

data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL);
if (!data) {
Expand Down
4 changes: 3 additions & 1 deletion drivers/hwmon/adt7470.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,8 +1286,10 @@ static int adt7470_probe(struct i2c_client *client,
init_completion(&data->auto_update_stop);
data->auto_update = kthread_run(adt7470_update_thread, client,
dev_name(data->hwmon_dev));
if (IS_ERR(data->auto_update))
if (IS_ERR(data->auto_update)) {
err = PTR_ERR(data->auto_update);
goto exit_unregister;
}

return 0;

Expand Down
8 changes: 4 additions & 4 deletions drivers/hwmon/gpio-fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,6 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
}
}

err = sysfs_create_group(&pdev->dev.kobj, &gpio_fan_ctrl_group);
if (err)
goto err_free_gpio;

fan_data->num_ctrl = num_ctrl;
fan_data->ctrl = ctrl;
fan_data->num_speed = pdata->num_speed;
Expand All @@ -391,6 +387,10 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
goto err_free_gpio;
}

err = sysfs_create_group(&pdev->dev.kobj, &gpio_fan_ctrl_group);
if (err)
goto err_free_gpio;

return 0;

err_free_gpio:
Expand Down

0 comments on commit 522a991

Please sign in to comment.