Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

From: Thomas Weißschuh
Date: Sun Oct 10 2021 - 06:21:34 EST


Hi,

for WMI drivers the list platform-driver-x86@xxxxxxxxxxxxxxx should probably be
on CC too.
Also all other WMI drivers, even for hwmon stuff are located in
drivers/platform/x86 so it may be better to put it there, too.

One comment inline.

On 2021-10-10T12:52+0300, Denis Pauk wrote:
> +static struct platform_driver asus_wmi_sensors_platform_driver = {
> + .driver = {
> + .name = "asus-wmi-sensors",
> + },
> + .probe = asus_wmi_probe,
> +};
> +
> +static struct platform_device *sensors_pdev;
> +
> +static int __init asus_wmi_init(void)
> +{
> + if (!dmi_check_system(asus_wmi_dmi_table))
> + return -ENODEV;
> +
> + sensors_pdev = platform_create_bundle(&asus_wmi_sensors_platform_driver,
> + asus_wmi_probe,
> + NULL, 0,
> + NULL, 0);
> +
> + return PTR_ERR_OR_ZERO(sensors_pdev);
> +}
> +module_init(asus_wmi_init);
> +
> +static void __exit asus_wmi_exit(void)
> +{
> + platform_device_unregister(sensors_pdev);
> + platform_driver_unregister(&asus_wmi_sensors_platform_driver);
> +}
> +module_exit(asus_wmi_exit);

This should bind to the WMI bus instead of being a platform device.
See drivers/platform/x86/gigabyte-wmi.c

(Some goes also for the other driver)

Thomas