Skip to content

Commit d8b17a3

Browse files
flukejonesij-intel
authored andcommitted
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: ae834a5 ("platform/x86: asus-wmi: add support variant of TUF RGB") Tested-by: Denis Benato <[email protected]> Signed-off-by: Luke D. Jones <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 182c694 commit d8b17a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/platform/x86/asus-wmi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,14 @@ static ssize_t kbd_rgb_mode_store(struct device *dev,
880880
struct device_attribute *attr,
881881
const char *buf, size_t count)
882882
{
883-
struct asus_wmi *asus = dev_get_drvdata(dev);
884883
u32 cmd, mode, r, g, b, speed;
884+
struct led_classdev *led;
885+
struct asus_wmi *asus;
885886
int err;
886887

888+
led = dev_get_drvdata(dev);
889+
asus = container_of(led, struct asus_wmi, kbd_led);
890+
887891
if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6)
888892
return -EINVAL;
889893

0 commit comments

Comments
 (0)