mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device()
@ 2023-10-06 15:53 Andy Shevchenko
  2023-10-06 17:08 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2023-10-06 15:53 UTC (permalink / raw)
  To: Andy Shevchenko, acpi4asus-user, platform-driver-x86, linux-kernel
  Cc: João Paulo Rechi Vita, Corentin Chary, Hans de Goede,
	Ilpo Järvinen, Mark Gross

Replace open coded acpi_match_device() in asus_wireless_add().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: rewrote error path logic (Hans)
v2: fixed compilation error
 drivers/platform/x86/asus-wireless.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c
index abf01e00b799..1a571efa02eb 100644
--- a/drivers/platform/x86/asus-wireless.c
+++ b/drivers/platform/x86/asus-wireless.c
@@ -148,16 +148,12 @@ static int asus_wireless_add(struct acpi_device *adev)
 	if (err)
 		return err;
 
-	for (id = device_ids; id->id[0]; id++) {
-		if (!strcmp((char *) id->id, acpi_device_hid(adev))) {
-			data->hswc_params =
-				(const struct hswc_params *)id->driver_data;
-			break;
-		}
-	}
-	if (!data->hswc_params)
+	id = acpi_match_device(device_ids, adev);
+	if (!id)
 		return 0;
 
+	data->hswc_params = (const struct hswc_params *)id->driver_data;
+
 	data->wq = create_singlethread_workqueue("asus_wireless_workqueue");
 	if (!data->wq)
 		return -ENOMEM;
-- 
2.40.0.1.gaa8946217a0b


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device()
  2023-10-06 15:53 [PATCH v3 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device() Andy Shevchenko
@ 2023-10-06 17:08 ` Hans de Goede
  2023-10-07  7:25   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2023-10-06 17:08 UTC (permalink / raw)
  To: Andy Shevchenko, acpi4asus-user, platform-driver-x86, linux-kernel
  Cc: João Paulo Rechi Vita, Corentin Chary, Ilpo Järvinen,
	Mark Gross

Hi,

On 10/6/23 17:53, Andy Shevchenko wrote:
> Replace open coded acpi_match_device() in asus_wireless_add().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v3: rewrote error path logic (Hans)
> v2: fixed compilation error
>  drivers/platform/x86/asus-wireless.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Thanks, patch looks good to me now:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> 
> diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c
> index abf01e00b799..1a571efa02eb 100644
> --- a/drivers/platform/x86/asus-wireless.c
> +++ b/drivers/platform/x86/asus-wireless.c
> @@ -148,16 +148,12 @@ static int asus_wireless_add(struct acpi_device *adev)
>  	if (err)
>  		return err;
>  
> -	for (id = device_ids; id->id[0]; id++) {
> -		if (!strcmp((char *) id->id, acpi_device_hid(adev))) {
> -			data->hswc_params =
> -				(const struct hswc_params *)id->driver_data;
> -			break;
> -		}
> -	}
> -	if (!data->hswc_params)
> +	id = acpi_match_device(device_ids, adev);
> +	if (!id)
>  		return 0;
>  
> +	data->hswc_params = (const struct hswc_params *)id->driver_data;
> +
>  	data->wq = create_singlethread_workqueue("asus_wireless_workqueue");
>  	if (!data->wq)
>  		return -ENOMEM;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device()
  2023-10-06 17:08 ` Hans de Goede
@ 2023-10-07  7:25   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2023-10-07  7:25 UTC (permalink / raw)
  To: Hans de Goede
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel,
	João Paulo Rechi Vita, Corentin Chary, Ilpo Järvinen,
	Mark Gross

On Fri, Oct 06, 2023 at 07:08:35PM +0200, Hans de Goede wrote:
> On 10/6/23 17:53, Andy Shevchenko wrote:

...

> Thanks, patch looks good to me now:
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Thanks, but it seems something went wrong (most likely due to age of the
patches in my local tree) and confusing "BUILD SUCCESS" from LKP.

> > +	id = acpi_match_device(device_ids, adev);

This should be acpi_match_acpi_device().

> > +	if (!id)
> >  		return 0;

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-07  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 15:53 [PATCH v3 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device() Andy Shevchenko
2023-10-06 17:08 ` Hans de Goede
2023-10-07  7:25   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome