Commit 50d88b1d authored by Haowen Bai's avatar Haowen Bai Committed by Hans de Goede

platform/x86: system76_acpi: Use dev_get_drvdata

Eliminate direct accesses to the driver_data field.
Signed-off-by: default avatarHaowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1653989063-20180-1-git-send-email-baihaowen@meizu.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 3cd8cc98
...@@ -339,7 +339,7 @@ static ssize_t kb_led_color_show( ...@@ -339,7 +339,7 @@ static ssize_t kb_led_color_show(
struct led_classdev *led; struct led_classdev *led;
struct system76_data *data; struct system76_data *data;
led = (struct led_classdev *)dev->driver_data; led = dev_get_drvdata(dev);
data = container_of(led, struct system76_data, kb_led); data = container_of(led, struct system76_data, kb_led);
return sysfs_emit(buf, "%06X\n", data->kb_color); return sysfs_emit(buf, "%06X\n", data->kb_color);
} }
...@@ -356,7 +356,7 @@ static ssize_t kb_led_color_store( ...@@ -356,7 +356,7 @@ static ssize_t kb_led_color_store(
unsigned int val; unsigned int val;
int ret; int ret;
led = (struct led_classdev *)dev->driver_data; led = dev_get_drvdata(dev);
data = container_of(led, struct system76_data, kb_led); data = container_of(led, struct system76_data, kb_led);
ret = kstrtouint(buf, 16, &val); ret = kstrtouint(buf, 16, &val);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment