platform/x86: system76_acpi: Use dev_get_drvdata

Eliminate direct accesses to the driver_data field.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1653989063-20180-1-git-send-email-baihaowen@meizu.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Haowen Bai 2022-05-31 17:24:23 +08:00 committed by Hans de Goede
parent 3cd8cc98d6
commit 50d88b1d1e
1 changed files with 2 additions and 2 deletions

View File

@ -339,7 +339,7 @@ static ssize_t kb_led_color_show(
struct led_classdev *led;
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);
return sysfs_emit(buf, "%06X\n", data->kb_color);
}
@ -356,7 +356,7 @@ static ssize_t kb_led_color_store(
unsigned int val;
int ret;
led = (struct led_classdev *)dev->driver_data;
led = dev_get_drvdata(dev);
data = container_of(led, struct system76_data, kb_led);
ret = kstrtouint(buf, 16, &val);
if (ret)