All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: system76_acpi: use dev_get_drvdata
@ 2022-05-31  9:24 Haowen Bai
  2022-06-10 19:10 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-05-31  9:24 UTC (permalink / raw)
  To: Jeremy Soller, System76 Product Development, Hans de Goede, Mark Gross
  Cc: Haowen Bai, platform-driver-x86, linux-kernel

Eliminate direct accesses to the driver_data field.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 drivers/platform/x86/system76_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/system76_acpi.c b/drivers/platform/x86/system76_acpi.c
index 7299ad08c838..958df41ad509 100644
--- a/drivers/platform/x86/system76_acpi.c
+++ b/drivers/platform/x86/system76_acpi.c
@@ -339,7 +339,7 @@ static ssize_t kb_led_color_show(
 	struct led_classdev *led;
 	struct system76_data *data;
 
-	led = (struct led_classdev *)dev->driver_data;
+	led = dev_get_drvdata(dev);
 	data = container_of(led, struct system76_data, kb_led);
 	return sysfs_emit(buf, "%06X\n", data->kb_color);
 }
@@ -356,7 +356,7 @@ static ssize_t kb_led_color_store(
 	unsigned int val;
 	int ret;
 
-	led = (struct led_classdev *)dev->driver_data;
+	led = dev_get_drvdata(dev);
 	data = container_of(led, struct system76_data, kb_led);
 	ret = kstrtouint(buf, 16, &val);
 	if (ret)
-- 
2.7.4


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

* Re: [PATCH] platform/x86: system76_acpi: use dev_get_drvdata
  2022-05-31  9:24 [PATCH] platform/x86: system76_acpi: use dev_get_drvdata Haowen Bai
@ 2022-06-10 19:10 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2022-06-10 19:10 UTC (permalink / raw)
  To: Haowen Bai, Jeremy Soller, System76 Product Development, Mark Gross
  Cc: platform-driver-x86, linux-kernel

Hi,

On 5/31/22 11:24, Haowen Bai wrote:
> Eliminate direct accesses to the driver_data field.
> 
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans

> ---
>  drivers/platform/x86/system76_acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/system76_acpi.c b/drivers/platform/x86/system76_acpi.c
> index 7299ad08c838..958df41ad509 100644
> --- a/drivers/platform/x86/system76_acpi.c
> +++ b/drivers/platform/x86/system76_acpi.c
> @@ -339,7 +339,7 @@ static ssize_t kb_led_color_show(
>  	struct led_classdev *led;
>  	struct system76_data *data;
>  
> -	led = (struct led_classdev *)dev->driver_data;
> +	led = dev_get_drvdata(dev);
>  	data = container_of(led, struct system76_data, kb_led);
>  	return sysfs_emit(buf, "%06X\n", data->kb_color);
>  }
> @@ -356,7 +356,7 @@ static ssize_t kb_led_color_store(
>  	unsigned int val;
>  	int ret;
>  
> -	led = (struct led_classdev *)dev->driver_data;
> +	led = dev_get_drvdata(dev);
>  	data = container_of(led, struct system76_data, kb_led);
>  	ret = kstrtouint(buf, 16, &val);
>  	if (ret)


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

end of thread, other threads:[~2022-06-10 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  9:24 [PATCH] platform/x86: system76_acpi: use dev_get_drvdata Haowen Bai
2022-06-10 19:10 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.