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 79ED3ECAAD3 for ; Fri, 9 Sep 2022 14:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231968AbiIIOna (ORCPT ); Fri, 9 Sep 2022 10:43:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230434AbiIIOn3 (ORCPT ); Fri, 9 Sep 2022 10:43:29 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EFE5110AA3; Fri, 9 Sep 2022 07:43:28 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id l10so1981906plb.10; Fri, 09 Sep 2022 07:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date; bh=itwUGd1Te1mSjRZ83ukeLvlZZen/Z6jAc3c4dT7PUuM=; b=eiTxh5Z/TuXFJclg3CW7GlqMhzXIzs40Q5nb6sMkkchg5kEMtgl8V7NcCc+V/AFFy1 iNwpBGFlbAHewEmKfdCbgqalyRW5fGfDW8hdPgjZipthynyfGbvPewpGLZt39j/9tcuh PEwkyJplF4dwjTWipSWEXhMr/9QW5/PwT9Zqli4rEEaDMIpIZ3fKdGTHa0UJDDDXXB2A yfYWlekEa3993lE4w/YiRo8nOCMMwAjLPfLnLcCJtiO4m1dc/wZp8IxKsdhni9B0qsz4 Ri/Jju+RPq1wjL/pJjr+XKhvUKvHx/Nqr/k+MB+hTWeYOJEWW8MjMvrYG5VrgV36SUsV lsFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date; bh=itwUGd1Te1mSjRZ83ukeLvlZZen/Z6jAc3c4dT7PUuM=; b=Fb7rTz4Q0WZfS7S96mZ52gRNvzpwSB6I52CLqHXoFvjnLinISOyimR7rNusOza7c58 nBRKZN56d5KKeNxE8WN13glsxqD658JuiZFDmqjOchk9TB9Te4hVBQAcN/2Hm9zwivX4 04Sda8dBBHa5UKPwmdtZaTCwCQCEnL2AdPI+qwsLysEJqdt9dL2XGDQZPHi4qHElZoXR oh0j70Czoq4MLczJ/ickn6OsEjf5hGFmtnnP7r3brcTKuqpeXOl5Is8Wg1sSgZzV89Vo JIS3Hc9bPCzKqhCgL07he/BuPTE1z/DJLiyJxEZRR5J4PT41ivzaduF+T9ljflIMfP/1 Ud3Q== X-Gm-Message-State: ACgBeo0+7Nb+4ichD+h5XV2ou+bv/jCkHzjXe+x8lkp1Ty9qbD4gDn4I BkaZlW0QJOMsMHPgHeNoGJU= X-Google-Smtp-Source: AA6agR5/Uh8A5sMDltA5OxD66RX3Nj35zygvhPbwQ0qODJgYHrZHZvjluWlMY0tp0uCHbPulGQz+HQ== X-Received: by 2002:a17:902:6b42:b0:174:4308:ce52 with SMTP id g2-20020a1709026b4200b001744308ce52mr14023716plt.81.1662734607666; Fri, 09 Sep 2022 07:43:27 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u16-20020a17090a0c5000b00200b2894648sm489793pje.52.2022.09.09.07.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 07:43:26 -0700 (PDT) Sender: Guenter Roeck Date: Fri, 9 Sep 2022 07:43:24 -0700 From: Guenter Roeck To: Eugene Shalygin Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: (asus-ec-sensors) autoload module via DMI data Message-ID: <20220909144324.GA2951669@roeck-us.net> References: <20220909113820.92360-1-eugene.shalygin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909113820.92360-1-eugene.shalygin@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org On Fri, Sep 09, 2022 at 01:38:20PM +0200, Eugene Shalygin wrote: > Replace autoloading data based on the ACPI EC device with the DMI > records for motherboards models. The ACPI method created a bug that when > this driver returns error from the probe function because of the > unsupported motherboard model, the ACPI subsystem concludes > that the EC device does not work properly. > > Fixes: 5cd29012028d > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216412 > Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2121844 > Signed-off-by: Eugene Shalygin > --- > drivers/hwmon/asus-ec-sensors.c | 413 ++++++++++++++++++-------------- > 1 file changed, 227 insertions(+), 186 deletions(-) > > diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c > index 61a4684fc020..206265ea8122 100644 > --- a/drivers/hwmon/asus-ec-sensors.c > +++ b/drivers/hwmon/asus-ec-sensors.c [ ... ] > + > +static void cleanup_device(void) > +{ > + platform_device_unregister(asus_ec_sensors_platform_device); > + platform_driver_unregister(&asus_ec_sensors_platform_driver); > +} > + > +static int __init asus_ec_init(void) > +{ > + asus_ec_sensors_platform_device = > + platform_create_bundle(&asus_ec_sensors_platform_driver, > + asus_ec_probe, NULL, 0, NULL, 0); > + > + if (IS_ERR(asus_ec_sensors_platform_device)) > + return PTR_ERR(asus_ec_sensors_platform_device); > + > + return 0; > +} > + > +static void __exit asus_ec_exit(void) > +{ > + cleanup_device(); I don't see the point of that extra function. Please drop and call platform_device_unregister() as well as platform_driver_unregister() directly. > +} > + > +module_init(asus_ec_init); > +module_exit(asus_ec_exit); > > module_param_named(mutex_path, mutex_path_override, charp, 0); > MODULE_PARM_DESC(mutex_path, > -- > 2.37.3 >