From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E25FC433F5 for ; Thu, 12 May 2022 16:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356330AbiELQMC (ORCPT ); Thu, 12 May 2022 12:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356319AbiELQLr (ORCPT ); Thu, 12 May 2022 12:11:47 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB3236668D; Thu, 12 May 2022 09:11:42 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1npBPf-0001Vm-00; Thu, 12 May 2022 18:11:39 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 402D2C01D7; Thu, 12 May 2022 18:08:27 +0200 (CEST) Date: Thu, 12 May 2022 18:08:27 +0200 From: Thomas Bogendoerfer To: Guenter Roeck Cc: Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Zhi Li Subject: Re: [PATCH] MIPS: Loongson: Use hwmon_device_register_with_groups() to register hwmon Message-ID: <20220512160827.GA14475@alpha.franken.de> References: <20220511145659.2976950-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220511145659.2976950-1-linux@roeck-us.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Guenter Roeck > --- > 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 ]