[PATCH] thermal: fix parameter when registering hwmon

From: Zhang Rui
Date: Tue Jan 24 2017 - 01:11:03 EST


commit 7611fb68062f ("thermal: thermal_hwmon: Convert to
hwmon_device_register_with_info()") converts thermal core to use
hwmon_device_register_with_info() to register to hwmon instead of
deprecated hwmon_device_register().
But at the same time, the name of the hwmon device created is changed to
the thermal zone device name in this commit, which may contain
incompatible characters for hwmon.

Fixes it by using exactly the same parameters as before this commit.

Fixes: 7611fb68062f ("thermal: thermal_hwmon: Convert to hwmon_devce_register_with_info()")
Reported-by: Pavel Machek <pavel@xxxxxx>
Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
drivers/thermal/thermal_hwmon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index c4a508a..0c6789f 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -157,8 +157,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_with_info(NULL, hwmon->type,
- hwmon, NULL, 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;
--
2.7.4


> Guenter
>
> > [ 2.064544] bq27xxx-battery 2-0055: failed to register battery
> > [ 2.064605] bq27xxx-battery: probe of 2-0055 failed with error -22
> > [ 2.065368] of_get_named_gpiod_flags: parsed 'power-gpio' property
> > of node '/ocp@68000000/i2c@48072000/tpa6130a2@60[0]' - status (0)
> > [ 2.083221] bq2415x-charger 2-006b: automode supported, waiting for
> > events
> > [ 2.084442] bq2415x-charger 2-006b: driver registered
> > --
> > [ 2.369842] g_ether gadget: g_ether ready
> > [ 2.377197] tsc2005 spi1.0: GPIO lookup for consumer reset
> > [ 2.377227] tsc2005 spi1.0: using device tree for GPIO lookup
> > [ 2.377288] of_get_named_gpiod_flags: parsed 'reset-gpios' property
> > of node '/ocp@68000000/spi@48098000/tsc2005@0[0]' - status (0)
> > [ 2.378936] input: TSC2005 touchscreen as
> > /devices/platform/68000000.ocp/48098000.spi/spi_master/spi1/spi1.0/input/input5
> > [ 2.395111] hwmon: Invalid character detected: rx51-battery
> > [ 2.402587] rx51-battery: probe of n900-battery failed with error
> > -22
> > [ 2.410247] omap_hsmmc 4809c000.mmc: GPIO lookup for consumer cd
> > [ 2.410247] omap_hsmmc 4809c000.mmc: using device tree for GPIO
> > lookup
> > [ 2.410278] of_get_named_gpiod_flags: can't parse 'cd-gpios'
> > property of node '/ocp@68000000/mmc@4809c000[0]'
> > [ 2.410278] of_get_named_gpiod_flags: can't parse 'cd-gpio'
> > property of node '/ocp@68000000/mmc@4809c000[0]'
> >
> > Pavel
> >
> >
> > --
> > (english) http://www.livejournal.com/~pavelmachek
> > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>
>