Commit b0c4b9c6 authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart (VMware)

platform/x86: fujitsu-laptop: simplify platform device attribute definitions

Use the DEVICE_ATTR_RO() macro to get rid of ignore_store() and shorten
attribute definitions.  Adjust whitespace to make checkpatch happy.
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Tested-by: default avatarJonathan Woithe <jwoithe@just42.net>
Reviewed-by: default avatarJonathan Woithe <jwoithe@just42.net>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 78b2602f
...@@ -480,16 +480,8 @@ static const struct backlight_ops fujitsu_bl_ops = { ...@@ -480,16 +480,8 @@ static const struct backlight_ops fujitsu_bl_ops = {
.update_status = bl_update_status, .update_status = bl_update_status,
}; };
static ssize_t static ssize_t lid_show(struct device *dev, struct device_attribute *attr,
ignore_store(struct device *dev, char *buf)
struct device_attribute *attr, const char *buf, size_t count)
{
return count;
}
static ssize_t
show_lid_state(struct device *dev,
struct device_attribute *attr, char *buf)
{ {
if (!(fujitsu_laptop->flags_supported & FLAG_LID)) if (!(fujitsu_laptop->flags_supported & FLAG_LID))
return sprintf(buf, "unknown\n"); return sprintf(buf, "unknown\n");
...@@ -499,9 +491,8 @@ show_lid_state(struct device *dev, ...@@ -499,9 +491,8 @@ show_lid_state(struct device *dev,
return sprintf(buf, "closed\n"); return sprintf(buf, "closed\n");
} }
static ssize_t static ssize_t dock_show(struct device *dev, struct device_attribute *attr,
show_dock_state(struct device *dev, char *buf)
struct device_attribute *attr, char *buf)
{ {
if (!(fujitsu_laptop->flags_supported & FLAG_DOCK)) if (!(fujitsu_laptop->flags_supported & FLAG_DOCK))
return sprintf(buf, "unknown\n"); return sprintf(buf, "unknown\n");
...@@ -511,9 +502,8 @@ show_dock_state(struct device *dev, ...@@ -511,9 +502,8 @@ show_dock_state(struct device *dev,
return sprintf(buf, "undocked\n"); return sprintf(buf, "undocked\n");
} }
static ssize_t static ssize_t radios_show(struct device *dev, struct device_attribute *attr,
show_radios_state(struct device *dev, char *buf)
struct device_attribute *attr, char *buf)
{ {
if (!(fujitsu_laptop->flags_supported & FLAG_RFKILL)) if (!(fujitsu_laptop->flags_supported & FLAG_RFKILL))
return sprintf(buf, "unknown\n"); return sprintf(buf, "unknown\n");
...@@ -523,9 +513,9 @@ show_radios_state(struct device *dev, ...@@ -523,9 +513,9 @@ show_radios_state(struct device *dev,
return sprintf(buf, "killed\n"); return sprintf(buf, "killed\n");
} }
static DEVICE_ATTR(lid, 0444, show_lid_state, ignore_store); static DEVICE_ATTR_RO(lid);
static DEVICE_ATTR(dock, 0444, show_dock_state, ignore_store); static DEVICE_ATTR_RO(dock);
static DEVICE_ATTR(radios, 0444, show_radios_state, ignore_store); static DEVICE_ATTR_RO(radios);
static struct attribute *fujitsu_pf_attributes[] = { static struct attribute *fujitsu_pf_attributes[] = {
&dev_attr_lid.attr, &dev_attr_lid.attr,
......
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