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.
Unified · Split
| @@ -880,10 +880,14 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, · 879 unmodified lines | ||
| 880 | 880 | struct device_attribute *attr, |
| 881 | 881 | const char *buf, size_t count) |
| 882 | 882 | { |
| 883 | − struct asus_wmi *asus = dev_get_drvdata(dev); | |
| 884 | 883 | u32 cmd, mode, r, g, b, speed; |
| 884 | + struct led_classdev *led; | |
| 885 | + struct asus_wmi *asus; | |
| 885 | 886 | int err; |
| 886 | 887 | |
| 888 | + led = dev_get_drvdata(dev); | |
| 889 | + asus = container_of(led, struct asus_wmi, kbd_led); | |
| 890 | + | |
| 887 | 891 | if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6) |
| 888 | 892 | return -EINVAL; |
| 889 | 893 | |