linux-stable/drivers/platform/mips
Guenter Roeck 646070b648 MIPS: Loongson: Use hwmon_device_register_with_groups() to register hwmon
[ Upstream commit abae018a03 ]

Calling hwmon_device_register_with_info() with NULL dev and/or chip
information parameters is an ABI abuse and not a real conversion to
the new API. Also, the code creates sysfs attributes _after_ creating
the hwmon device, which is racy and unsupported to start with. On top
of that, the removal code tries to remove the name attribute which is
owned by the hwmon core.

Use hwmon_device_register_with_groups() to register the hwmon device
instead.

In the future, the hwmon subsystem will reject calls to
hwmon_device_register_with_info with NULL dev or chip/info parameters.
Without this patch, the hwmon device will fail to register.

Fixes: f59dc51191 ("MIPS: Loongson: Fix boot warning about hwmon_device_register()")
Cc: Zhi Li <lizhi01@loongson.cn>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:23:14 +02:00
..
cpu_hwmon.c MIPS: Loongson: Use hwmon_device_register_with_groups() to register hwmon 2022-06-09 10:23:14 +02:00
Kconfig
Makefile
rs780e-acpi.c