thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
RFC 1/1 thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
From: Fabio Estevam <[email protected]>
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 as suggested.
--- drivers/thermal/thermal_hwmon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/thermal_hwmon.c +2 -1
@@ -165,7 +165,8 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)INIT_LIST_HEAD (&hwmon->tz_list);strlcpy (hwmon->type, tz->type,THERMAL_NAME_LENGTH ); - hwmon->device =hwmon_device_register (NULL ); + hwmon->device =hwmon_device_register_with_info (NULL ,NULL ,NULL , +NULL ,NULL );if (IS_ERR (hwmon->device)) { result =PTR_ERR (hwmon->device); goto free_mem;
Signature · 1 line
2.7.4
Quoted 19 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Booting Linux on a mx6q based board leads to the following warning:
(NULL device *):
hwmon_device_register()is deprecated. Please convert the driver to usehwmon_device_register_with_info().,so do as suggested.
Signed-off-by Fabio Estevam <[email protected]>--- drivers/thermal/thermal_hwmon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/thermal/thermal_hwmon.c +0
-0
drivers/thermal/thermal_hwmon.c int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) · line 169
Quoted 6 lines
drivers/thermal/thermal_hwmon.c +2
-1@@ -165,7 +165,8 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)INIT_LIST_HEAD (&hwmon->tz_list);strlcpy (hwmon->type, tz->type,THERMAL_NAME_LENGTH ); - hwmon->device =hwmon_device_register (NULL ); + hwmon->device =hwmon_device_register_with_info (NULL ,NULL ,NULL , +NULL ,NULL );
Interesting way of defeating the purpose ;-).
Any interest in at least trying (NULL, hwmon->type, hwmon, NULL, NULL) ?
This should result in the core taking care of creating the 'name' attribute, so it should be possible to drop the code doing that from the thermal driver.
Guenter
Quoted 4 lines
drivers/thermal/thermal_hwmon.c +0
-0if (IS_ERR (hwmon->device)) { result =PTR_ERR (hwmon->device); goto free_mem;
Quoted 1 line · Guenter Roeck
Interesting way of defeating the purpose ;-).
Yes, that's why I marked it as RFC. Thanks for your feedback.
Quoted 1 line
Any interest in at least trying (NULL,
hwmon->type, hwmon, NULL, NULL) ?
Yes, it works.
Quoted 3 lines
This should result in the core taking care of creating the 'name' attribute, so it should be possible to drop the code doing that from the thermal driver.
Correct. I had to remove the device_create_file() call from the thermal driver so that it can successfully probe.
Will resend it soon, thanks!