Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 522a9914 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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()
parents 8a9f772c 4f5b7994
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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) {
+3 −1
Original line number Diff line number Diff line
@@ -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;

+4 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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: