platform/x86: asus-wmi: fix TUF laptop RGB variant
Luke D. Jones
maintainercover platform/x86: asus-wmi: fix TUF laptop RGB variant
Changelog
- v1:
- Fix subject and fixes tag
History:
- v0: https://lore.kernel.org/platform-driver-x86/[email protected]/T/#m9ceb12d4d135e28e71e4d74ecc9a78083a6c8745
Luke D. Jones (1):
platform/x86: asus-wmi: fix TUF laptop RGB variant
drivers/platform/x86/asus-wmi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.45.2
Luke D. Jones
maintainerPATCH 1/1 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.
--- drivers/platform/x86/asus-wmi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +5 -1
@@ -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 ;
Signature · 1 line
2.45.2
Hi,
Quoted 9 lines · Luke D. Jones
In
kbd_rgb_mode_storethedev_get_drvdata()call was assuming the device data wasasus_wmiwhen it was actuallyled_classdev.This patch corrects this by making the correct chain of calls to get the
asus_wmidriver data.Fixes ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB")Tested-by Denis Benato <[email protected]>Signed-off-by Luke D. Jones <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 24 lines
--- drivers/platform/x86/asus-wmi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/asus-wmi.c +5
-1@@ -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 ;
Ilpo Järvinen
maintainerQuoted 22 lines · Luke D. Jones
In
kbd_rgb_mode_storethedev_get_drvdata()call was assuming the device data wasasus_wmiwhen it was actuallyled_classdev.This patch corrects this by making the correct chain of calls to get the
asus_wmidriver data.Fixes ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB")Tested-by Denis Benato <[email protected]>Signed-off-by Luke D. Jones <[email protected]>--- drivers/platform/x86/asus-wmi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/asus-wmi.c +0
-1@@ -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);
drivers/platform/x86/asus-wmi.c static ssize_t kbd_rgb_mode_store(struct device *dev, · line 918
Quoted 10 lines
drivers/platform/x86/asus-wmi.c +5
-0u32 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 ;
Thanks. Applied to review-ilpo / for-next and will go into Linus in the main PR for 6.11.
Signature · 1 line
i.
Hi,
Quoted 3 lines · Luke D. Jones
Changelog
- v1:
- Fix subject and fixes tag
Small remark for the next time you post a new version of a patch.
Since you already posted the version with the Fixes tag as subject before, this is v2; and ...
Quoted 2 lines
History:
- v0: https://lore.kernel.org/platform-driver-x86/[email protected]/T/#m9ceb12d4d135e28e71e4d74ecc9a78083a6c8745
This would be v1.
Regards,
Hans