[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1410563212-31565-6-git-send-email-fransklaver@gmail.com>
Date: Sat, 13 Sep 2014 01:06:44 +0200
From: Frans Klaver <fransklaver@...il.com>
To: Darren Hart <dvhart@...radead.org>
Cc: Frans Klaver <fransklaver@...il.com>,
Corentin Chary <corentin.chary@...il.com>,
Rafael Wysocki <rafael.j.wysocki@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
acpi4asus-user@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 05/13] eeepc-laptop: use DEVICE_ATTR to instantiate device_attributes
Signed-off-by: Frans Klaver <fransklaver@...il.com>
---
drivers/platform/x86/eeepc-laptop.c | 35 +++++------------------------------
1 file changed, 5 insertions(+), 30 deletions(-)
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index f35d008..8225b1e 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -308,13 +308,7 @@ static ssize_t show_sys_acpi(struct device *dev, int cm, char *buf)
{ \
return store_sys_acpi(dev, _cm, buf, count); \
} \
- static struct device_attribute dev_attr_##_name = { \
- .attr = { \
- .name = __stringify(_name), \
- .mode = _mode }, \
- .show = show_##_name, \
- .store = store_##_name, \
- }
+ static DEVICE_ATTR(_name, _mode, show_##_name, store_##_name)
EEEPC_CREATE_DEVICE_ATTR(camera, S_IWUSR | S_IRUGO, CM_ASL_CAMERA);
EEEPC_CREATE_DEVICE_ATTR(cardr, S_IWUSR | S_IRUGO, CM_ASL_CARDREADER);
@@ -420,29 +414,10 @@ static ssize_t store_cpufv_disabled(struct device *dev,
}
-static struct device_attribute dev_attr_cpufv = {
- .attr = {
- .name = "cpufv",
- .mode = S_IWUSR | S_IRUGO },
- .show = show_cpufv,
- .store = store_cpufv
-};
-
-static struct device_attribute dev_attr_available_cpufv = {
- .attr = {
- .name = "available_cpufv",
- .mode = S_IRUGO },
- .show = show_available_cpufv
-};
-
-static struct device_attribute dev_attr_cpufv_disabled = {
- .attr = {
- .name = "cpufv_disabled",
- .mode = S_IWUSR | S_IRUGO},
- .show = show_cpufv_disabled,
- .store = store_cpufv_disabled
-};
-
+static DEVICE_ATTR(cpufv, S_IWUSR | S_IRUGO, show_cpufv, store_cpufv);
+static DEVICE_ATTR(available_cpufv, S_IRUGO, show_available_cpufv, NULL);
+static DEVICE_ATTR(cpufv_disabled, S_IWUSR | S_IRUGO,
+ show_cpufv_disabled, store_cpufv_disabled);
static struct attribute *platform_attributes[] = {
&dev_attr_camera.attr,
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists