Currently, all fan control operations return ENXIO if unsupported
operations are requested, but return EINVAL if invalid fan modes are
requested on a given ThinkPad.
This is not strictly correct for sysfs, so map ENXIO to EINVAL in the sysfs
attribute store handlers, as we do benefit from the ENXIO in other parts of
the driver code.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
}
res = fan_set_level_safe(level);
- if (res < 0)
+ if (res == -ENXIO)
+ return -EINVAL;
+ else if (res < 0)
return res;
fan_watchdog_reset();
if (!rc && (status &
(TP_EC_FAN_AUTO | TP_EC_FAN_FULLSPEED)) == 0) {
rc = fan_set_level(newlevel);
- if (!rc) {
+ if (rc == -ENXIO)
+ rc = -EINVAL;
+ else if (!rc) {
fan_update_desired_level(newlevel);
fan_watchdog_reset();
}