• Linus Walleij's avatar
    hwmon: Deal with errors from the thermal subsystem · 47c332de
    Linus Walleij authored
    If the thermal subsystem returne -EPROBE_DEFER or any other error
    when hwmon calls devm_thermal_zone_of_sensor_register(), this is
    silently ignored.
    
    I ran into this with an incorrectly defined thermal zone, making
    it non-existing and thus this call failed with -EPROBE_DEFER
    assuming it would appear later. The sensor was still added
    which is incorrect: sensors must strictly be added after the
    thermal zones, so deferred probe must be respected.
    
    Fixes: d560168b ("hwmon: (core) New hwmon registration API")
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    47c332de
hwmon.c 23.5 KB