[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220512160827.GA14475@alpha.franken.de>
Date: Thu, 12 May 2022 18:08:27 +0200
From: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Huacai Chen <chenhuacai@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org, Zhi Li <lizhi01@...ngson.cn>
Subject: Re: [PATCH] MIPS: Loongson: Use hwmon_device_register_with_groups()
to register hwmon
On Wed, May 11, 2022 at 07:56:59AM -0700, Guenter Roeck wrote:
> 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: f59dc5119192 ("MIPS: Loongson: Fix boot warning about hwmon_device_register()")
> Cc: Zhi Li <lizhi01@...ngson.cn>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> ---
> drivers/platform/mips/cpu_hwmon.c | 127 ++++++++++--------------------
> 1 file changed, 41 insertions(+), 86 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
Powered by blists - more mailing lists