Explorar el Código

hwmon: (emc2103) Return error from i2c_smbus_read_byte_data

There is no reason to replace one error with another.

smatch message:
drivers/hwmon/emc2103.c:352 set_fan_div() info: why not propagate 'status'
from i2c_smbus_read_byte_data() instead of (-5)?

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Guenter Roeck hace 11 años
padre
commit
9bf3babf3f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      drivers/hwmon/emc2103.c

+ 1 - 1
drivers/hwmon/emc2103.c

@@ -349,7 +349,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da,
 		dev_dbg(&client->dev, "reg 0x%02x, err %d\n",
 			REG_FAN_CONF1, status);
 		mutex_unlock(&data->update_lock);
-		return -EIO;
+		return status;
 	}
 	status &= 0x9F;
 	status |= (new_range_bits << 5);