From: Haowen Bai <baihaowen@meizu.com>
To: Jeremy Soller <jeremy@system76.com>,
System76 Product Development <productdev@system76.com>,
Hans de Goede <hdegoede@redhat.com>,
Mark Gross <markgross@kernel.org>
Cc: Haowen Bai <baihaowen@meizu.com>,
<platform-driver-x86@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] platform/x86: system76_acpi: use dev_get_drvdata
Date: Tue, 31 May 2022 17:24:23 +0800 [thread overview]
Message-ID: <1653989063-20180-1-git-send-email-baihaowen@meizu.com> (raw)
Eliminate direct accesses to the driver_data field.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
drivers/platform/x86/system76_acpi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/system76_acpi.c b/drivers/platform/x86/system76_acpi.c
index 7299ad08c838..958df41ad509 100644
--- a/drivers/platform/x86/system76_acpi.c
+++ b/drivers/platform/x86/system76_acpi.c
@@ -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)
--
2.7.4
next reply other threads:[~2022-05-31 9:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-31 9:24 Haowen Bai [this message]
2022-06-10 19:10 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1653989063-20180-1-git-send-email-baihaowen@meizu.com \
--to=baihaowen@meizu.com \
--cc=hdegoede@redhat.com \
--cc=jeremy@system76.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=productdev@system76.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®