public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wilken Gottwalt <wilken.gottwalt@posteo.net>
To: Aleksa Savic <savicaleksa83@gmail.com>
Cc: linux-hwmon@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (corsair-psu) Fix failure to load when built-in to kernel
Date: Fri,  8 Dec 2023 13:57:42 +0000	[thread overview]
Message-ID: <20231208145742.6def047a@posteo.net> (raw)
In-Reply-To: <d91d4bf1-3e8d-4b63-baa9-479a91d04eb7@gmail.com>

On Fri, 8 Dec 2023 14:11:44 +0100
Aleksa Savic <savicaleksa83@gmail.com> wrote:

> On 2023-12-08 14:07:10 GMT+01:00, Aleksa Savic wrote:
> > When built-in to the kernel, the corsair-psu driver fails to register with
> > the following message:
> > 
> > "Driver 'corsair-psu' was unable to register with bus_type 'hid'
> > because the bus was not initialized."
> > 
> > Fix this by initializing the driver after the HID bus using
> > late_initcall(), as hwmon is built before HID.
> > 
> > Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver")
> > Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
> > ---
> >  drivers/hwmon/corsair-psu.c | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c
> > index 904890598c11..48831a528965 100644
> > --- a/drivers/hwmon/corsair-psu.c
> > +++ b/drivers/hwmon/corsair-psu.c
> > @@ -899,7 +899,20 @@ static struct hid_driver corsairpsu_driver = {
> >  	.reset_resume	= corsairpsu_resume,
> >  #endif
> >  };
> > -module_hid_driver(corsairpsu_driver);
> > +
> > +static int __init corsairpsu_hid_init(void)
> > +{
> > +	return hid_register_driver(&corsairpsu_driver);
> > +}
> > +
> > +static void __exit corsairpsu_hid_exit(void)
> > +{
> > +	hid_unregister_driver(&corsairpsu_driver);
> > +}
> > +
> > +/* When compiled into the kernel, initialize after the hid bus */
> > +late_initcall(corsairpsu_hid_init);
> > +module_exit(corsairpsu_hid_exit);
> >  
> >  MODULE_LICENSE("GPL");
> >  MODULE_AUTHOR("Wilken Gottwalt <wilken.gottwalt@posteo.net>");
> 
> 
> Woops! Just saw that the same fix was sent yesterday. Please disregard, sorry!
>
> Aleksa

It is fine. I just start to wonder if there was a change in the subsystem. I
used the driver as built-in in the past for several months and never had that
issue. And now it is a real flood of reports.

greetings,
Will

  reply	other threads:[~2023-12-08 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 13:07 [PATCH] hwmon: (corsair-psu) Fix failure to load when built-in to kernel Aleksa Savic
2023-12-08 13:11 ` Aleksa Savic
2023-12-08 13:57   ` Wilken Gottwalt [this message]
2023-12-08 15:43     ` Guenter Roeck
2023-12-08 16:52       ` Aleksa Savic
2023-12-08 18:34         ` Guenter Roeck

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=20231208145742.6def047a@posteo.net \
    --to=wilken.gottwalt@posteo.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=savicaleksa83@gmail.com \
    /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