lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67069bf0-58d9-44d3-94ac-4cbc2647d447@gmx.de>
Date:   Thu, 7 Dec 2023 21:48:43 +0100
From:   Armin Wolf <W_Armin@....de>
To:     Aleksa Savic <savicaleksa83@...il.com>, linux-hwmon@...r.kernel.org
Cc:     Jean Delvare <jdelvare@...e.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] hwmon: Add driver for Gigabyte AORUS Waterforce AIO
 coolers

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@...il.com>");
>>> +MODULE_DESCRIPTION("Hwmon driver for Gigabyte AORUS Waterforce AIO coolers");
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ