]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Nov 2010 17:50:54 +0000 (09:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Nov 2010 17:50:54 +0000 (09:50 -0800)
* '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()

drivers/hwmon/ad7414.c
drivers/hwmon/adt7470.c
drivers/hwmon/gpio-fan.c

index 1e4c21fc1a890b38894e26f0b0713fef1bb0fd63..86d822aa9bbf78a75ff20d1e4bff1bb0623d3a79 100644 (file)
@@ -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) {
index 9e775717abb7f36ab8c7aaf8103de53264e95951..87d92a56a939fcc531c934a1dd70f6ab6f83ab0c 100644 (file)
@@ -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;
 
index aa701a18370793a080a40be5e865465e83820159..f141a1de519cb2af822deef686229734c6d94249 100644 (file)
@@ -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: