public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kurt Borja" <kuurtb@gmail.com>
To: "Andy Shevchenko" <andriy.shevchenko@intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Armin Wolf" <W_Armin@gmx.de>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	Dell.Client.Kernel@dell.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 02/14] platform/x86: alienware-wmi: Add WMI Drivers
Date: Tue, 11 Feb 2025 12:46:40 -0500	[thread overview]
Message-ID: <D7PSZ410LJW6.3VNZ4VU0H5VUC@gmail.com> (raw)
In-Reply-To: <Z6t7IjcOFuAbztfn@black.fi.intel.com>

On Tue Feb 11, 2025 at 11:30 AM -05, Andy Shevchenko wrote:
> On Fri, Feb 07, 2025 at 10:45:58AM -0500, Kurt Borja wrote:
>> Add WMI drivers for LEGACY and WMAX devices.
>> 
>> This involves moving the platform device registration to a helper
>> function that is now called from the driver's preferred WMI device
>> driver probe. In the case of the WMAX this is done only if
>> `!quirks->thermal` because the newer WMAX interface doesn't support any
>> of the LED features of this driver. This also eliminates the need to
>> check for `quirks->num_zones > 0` inside alienfx_probe().
>> 
>> Only one WMI driver is registered on module initialization to prevent
>> registering a duplicate platform device.
>> 
>> Additionally, create_thermal_profile() now takes wmi_device * instead of
>> platform_device *.
>
> ...
>
>> +static int alienware_alienfx_setup(struct alienfx_platdata *pdata)
>> +{
>> +	struct device *dev = &pdata->wdev->dev;
>> +	struct platform_device *pdev;
>>  	int ret;
>>  
>> +	pdev = platform_device_register_data(NULL, "alienware-wmi",
>> +					     PLATFORM_DEVID_NONE, pdata,
>> +					     sizeof(*pdata));
>> +	if (IS_ERR(pdev))
>> +		return PTR_ERR(pdev);
>> +
>> +	dev_set_drvdata(dev, pdev);
>> +	ret = devm_add_action_or_reset(dev, alienware_alienfx_remove, pdev);
>> +	if (ret)
>> +		return ret;
>> +
>> +	return 0;
>
> 	return devm_add_action_or_reset(...);

Right!

>
>> +}
>
> ...
>
>> +static const struct wmi_device_id alienware_legacy_device_id_table[] = {
>> +	{ LEGACY_CONTROL_GUID, NULL },
>
> Drop that ' , NULL' part, it makes an additional burden if the type of the
> driver_data is ever changed.

Makes sense.

>
>> +	{ },
>
> No comma in the terminator entries.

Makes sense.

>
>> +};
>
> ...
>
>> +static const struct wmi_device_id alienware_wmax_device_id_table[] = {
>> +	{ WMAX_CONTROL_GUID, NULL },
>> +	{ },
>> +};
>
> Ditto.
>
> ...
>
>> +static int __init alienware_wmax_wmi_init(void)
>> +{
>> +	return wmi_driver_register(&alienware_wmax_wmi_driver);
>> +}
>> +
>> +static void __exit alienware_wmax_wmi_exit(void)
>> +{
>> +	wmi_driver_unregister(&alienware_wmax_wmi_driver);
>> +}
>
> I believe we have module_wmi_driver() which can be used after the split
> (haven't checked those patches yet).

This module has two WMI drivers, so I believe this can't be used.

-- 
 ~ Kurt


  reply	other threads:[~2025-02-11 17:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 15:45 [PATCH v10 00/14] platform/x86: alienware-wmi driver rework Kurt Borja
2025-02-07 15:45 ` [PATCH v10 01/14] platform/x86: alienware-wmi: Add a state container for LED control feature Kurt Borja
2025-02-07 15:45 ` [PATCH v10 02/14] platform/x86: alienware-wmi: Add WMI Drivers Kurt Borja
2025-02-11 16:30   ` Andy Shevchenko
2025-02-11 17:46     ` Kurt Borja [this message]
2025-02-11 18:51       ` Andy Shevchenko
2025-02-07 15:45 ` [PATCH v10 03/14] platform/x86: alienware-wmi: Add a state container for thermal control methods Kurt Borja
2025-02-07 15:46 ` [PATCH v10 04/14] platform/x86: alienware-wmi: Refactor LED " Kurt Borja
2025-02-11 16:33   ` Andy Shevchenko
2025-02-11 17:47     ` Kurt Borja
2025-02-07 15:46 ` [PATCH v10 05/14] platform/x86: alienware-wmi: Refactor hdmi, amplifier, deepslp methods Kurt Borja
2025-02-11 16:37   ` Andy Shevchenko
2025-02-11 17:51     ` Kurt Borja
2025-02-11 18:55       ` Andy Shevchenko
2025-02-07 15:46 ` [PATCH v10 06/14] platform/x86: alienware-wmi: Refactor thermal control methods Kurt Borja
2025-02-07 15:46 ` [PATCH v10 07/14] platform/x86: alienware-wmi: Split DMI table Kurt Borja
2025-02-11 16:39   ` Andy Shevchenko
2025-02-11 17:53     ` Kurt Borja
2025-02-07 15:46 ` [PATCH v10 08/14] MAINTAINERS: Update ALIENWARE WMI DRIVER entry Kurt Borja
2025-02-07 15:46 ` [PATCH v10 09/14] platform/x86: Rename alienware-wmi.c Kurt Borja
2025-02-11 16:41   ` Andy Shevchenko
2025-02-11 17:31     ` Kurt Borja
2025-02-11 18:50       ` Andy Shevchenko
2025-02-07 15:46 ` [PATCH v10 10/14] platform/x86: Add alienware-wmi.h Kurt Borja
2025-02-11 16:45   ` Andy Shevchenko
2025-02-11 16:51     ` Ilpo Järvinen
2025-02-11 17:19       ` Andy Shevchenko
2025-02-11 17:53     ` Kurt Borja
2025-02-07 15:46 ` [PATCH v10 11/14] platform/x86: Split the alienware-wmi driver Kurt Borja
2025-02-11 16:56   ` Andy Shevchenko
2025-02-11 17:59     ` Kurt Borja
2025-02-11 19:04       ` Andy Shevchenko
2025-02-14 22:21         ` Kurt Borja
2025-02-16 20:35           ` Andy Shevchenko
2025-02-07 15:46 ` [PATCH v10 12/14] platform/x86: dell: Modify Makefile alignment Kurt Borja
2025-02-11 16:56   ` Andy Shevchenko
2025-02-07 15:46 ` [PATCH v10 13/14] platform/x86: Update alienware-wmi config entries Kurt Borja
2025-02-07 15:46 ` [PATCH v10 14/14] platform/x86: alienware-wmi: Update header and module information Kurt Borja
2025-02-10 11:53 ` [PATCH v10 00/14] platform/x86: alienware-wmi driver rework Ilpo Järvinen
2025-02-10 13:48   ` Kurt Borja
2025-02-11 16:58     ` Andy Shevchenko
2025-02-11 18:09       ` Kurt Borja

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=D7PSZ410LJW6.3VNZ4VU0H5VUC@gmail.com \
    --to=kuurtb@gmail.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=W_Armin@gmx.de \
    --cc=andriy.shevchenko@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@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