[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3171ddf0-0228-48e6-8351-f4a9e56b11a3@redhat.com>
Date: Tue, 16 Jul 2024 11:23:11 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: "Luke D. Jones" <luke@...nes.dev>, platform-driver-x86@...r.kernel.org
Cc: corentin.chary@...il.com, ilpo.jarvinen@...ux.intel.com,
linux-kernel@...r.kernel.org, Denis Benato <benato.denis96@...il.com>
Subject: Re: [PATCH v1 1/1] platform/x86: asus-wmi: fix TUF laptop RGB variant
Hi,
On 7/16/24 3:11 AM, Luke D. Jones wrote:
> In kbd_rgb_mode_store the dev_get_drvdata() call was assuming the device
> data was asus_wmi when it was actually led_classdev.
>
> This patch corrects this by making the correct chain of calls to get the
> asus_wmi driver data.
>
> Fixes: ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB")
> Tested-by: Denis Benato <benato.denis96@...il.com>
> Signed-off-by: Luke D. Jones <luke@...nes.dev>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@...hat.com>
Regards,
Hans
> ---
> drivers/platform/x86/asus-wmi.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 7d87ff68f418..2b968003cb9b 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -906,10 +906,14 @@ static ssize_t kbd_rgb_mode_store(struct device *dev,
> struct device_attribute *attr,
> const char *buf, size_t count)
> {
> - struct asus_wmi *asus = dev_get_drvdata(dev);
> u32 cmd, mode, r, g, b, speed;
> + struct led_classdev *led;
> + struct asus_wmi *asus;
> int err;
>
> + led = dev_get_drvdata(dev);
> + asus = container_of(led, struct asus_wmi, kbd_led);
> +
> if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6)
> return -EINVAL;
>
Powered by blists - more mailing lists