From: Armin Wolf <W_Armin@gmx.de>
To: Aleksa Savic <savicaleksa83@gmail.com>, linux-hwmon@vger.kernel.org
Cc: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] hwmon: Add driver for Gigabyte AORUS Waterforce AIO coolers
Date: Thu, 7 Dec 2023 21:48:43 +0100 [thread overview]
Message-ID: <67069bf0-58d9-44d3-94ac-4cbc2647d447@gmx.de> (raw)
In-Reply-To: <f6522abb-885d-4476-bf27-5ee8b48138bd@gmail.com>
Am 07.12.23 um 21:04 schrieb Aleksa Savic:
> On 2023-12-07 20:39:23 GMT+01:00, Armin Wolf wrote:
>> Am 07.12.23 um 13:23 schrieb Aleksa Savic:
>>
> ...
>
>>> +
>>> +static struct hid_driver waterforce_driver = {
>>> + .name = "waterforce",
>>> + .id_table = waterforce_table,
>>> + .probe = waterforce_probe,
>>> + .remove = waterforce_remove,
>>> + .raw_event = waterforce_raw_event,
>>> +};
>>> +
>>> +static int __init waterforce_init(void)
>>> +{
>>> + return hid_register_driver(&waterforce_driver);
>>> +}
>>> +
>>> +static void __exit waterforce_exit(void)
>>> +{
>>> + hid_unregister_driver(&waterforce_driver);
>>> +}
>>> +
>>> +/* When compiled into the kernel, initialize after the HID bus */
>>> +late_initcall(waterforce_init);
>>> +module_exit(waterforce_exit);
>> Hi,
>>
>> I think you could use the module_hid_driver() macro here.
> As far as I'm aware, hwmon will get built before hid, so a late_initcall()
> is necessary for this to function when compiled as a built-in driver. Other
> HID drivers in hwmon also do this (see nzxt-smart2 for an example).
>
> Aleksa
>
Interesting, in this case forget about my suggestion above.
Armin Wolf
>>> +
>>> +MODULE_LICENSE("GPL");
>>> +MODULE_AUTHOR("Aleksa Savic <savicaleksa83@gmail.com>");
>>> +MODULE_DESCRIPTION("Hwmon driver for Gigabyte AORUS Waterforce AIO coolers");
>
next prev parent reply other threads:[~2023-12-07 20:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 12:23 Aleksa Savic
2023-12-07 19:39 ` Armin Wolf
2023-12-07 20:04 ` Aleksa Savic
2023-12-07 20:48 ` Armin Wolf [this message]
2023-12-11 14:41 ` 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=67069bf0-58d9-44d3-94ac-4cbc2647d447@gmx.de \
--to=w_armin@gmx.de \
--cc=corbet@lwn.net \
--cc=jdelvare@suse.com \
--cc=linux-doc@vger.kernel.org \
--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
all inboxes | Powered by JetHome®