From: Guenter Roeck <linux@roeck-us.net>
To: Eugene Shalygin <eugene.shalygin@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (asus-ec-sensors) autoload module via DMI data
Date: Fri, 9 Sep 2022 07:43:24 -0700 [thread overview]
Message-ID: <20220909144324.GA2951669@roeck-us.net> (raw)
In-Reply-To: <20220909113820.92360-1-eugene.shalygin@gmail.com>
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 <eugene.shalygin@gmail.com>
> ---
> 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
>
prev parent reply other threads:[~2022-09-09 14:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-09 11:38 [PATCH] hwmon: (asus-ec-sensors) autoload module via DMI data Eugene Shalygin
2022-09-09 14:43 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220909144324.GA2951669@roeck-us.net \
--to=linux@roeck-us.net \
--cc=eugene.shalygin@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox