• Fabio Estevam's avatar
    thermal: thermal_hwmon: Convert to hwmon_device_register_with_info() · e782bc16
    Fabio Estevam authored
    Booting Linux on a mx6q based board leads to the following warning:
    
    (NULL device *): hwmon_device_register() is deprecated. Please convert the
    driver to use hwmon_device_register_with_info().
    
    , so do the conversion as suggested.
    
    Also, this results in the core taking care of creating the 'name'
    attribute, so drop the code doing that from the thermal driver.
    
    The initial attempt to convert this driver to
    hwmon_device_register_with_info() caused issues on the N900 platform
    in commit 7611fb68 ("thermal: thermal_hwmon: Convert to
    hwmon_device_register_with_info()"):
    
    bq27xxx-battery 2-0055: failed to register battery
    bq27xxx-battery: probe of 2-0055 failed with error -22
    ...
    rx51-battery: probe of n900-battery failed with error -22
    
    , leading to a revert in commit 3feb479c ("Revert "thermal:
    thermal_hwmon: Convert to hwmon_device_register_with_info()"").
    
    The probe errors happened due to the '-' character being present in
    the name of the power supply devices: bq27200-0 and rx51-battery.
    
    Since commit 74d3b641
    
     ("hwmon: Relax name attribute validation
    for new APIs") hwmon will no longer treat these names as errors,
    allowing the transition for hwmon_device_register_with_info() to
    happen in a safely manner.
    
    Cc: Pavel Machek <pavel@ucw.cz>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
    Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    e782bc16
thermal_hwmon.c 7.09 KB