platform/x86: asus-wmi: fix TUF laptop RGB variant

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: ae834a549e ("platform/x86: asus-wmi: add support variant of TUF RGB")
Tested-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240716011130.17464-2-luke@ljones.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Luke D. Jones 2024-07-16 13:11:30 +12:00 committed by Ilpo Järvinen
parent 182c6941c5
commit d8b17a364e
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31

View File

@ -880,10 +880,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;