hwmon: (amc6821) Fix return value
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 11 Sep 2013 04:19:50 +0000 (09:49 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 11 Sep 2013 20:01:40 +0000 (13:01 -0700)
Propagate return value obtained from i2c_smbus_read_byte_data()
instead of hardcoding.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: T. Mertelj <tomaz.mertelj@guest.arnes.si>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/amc6821.c

index 4fe49d2bfe1de5c44b61b6bb3cbcfa3acecec41e..fcb18535fd56a277ce1337597498ce3be34048d9 100644 (file)
@@ -364,7 +364,7 @@ static ssize_t set_pwm1_enable(
        if (config < 0) {
                        dev_err(&client->dev,
                        "Error reading configuration register, aborting.\n");
-                       return -EIO;
+                       return config;
        }
 
        switch (val) {
@@ -665,7 +665,7 @@ static ssize_t set_fan1_div(
        if (config < 0) {
                dev_err(&client->dev,
                        "Error reading configuration register, aborting.\n");
-               return -EIO;
+               return config;
        }
        mutex_lock(&data->update_lock);
        switch (val) {