Commit 3935787e authored by Zhen Lei's avatar Zhen Lei Committed by Rafael J. Wysocki

PNP: use DEVICE_ATTR_RO macro

Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes
the code a bit shorter and easier to read.
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5bb5ceac
...@@ -181,7 +181,7 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp ...@@ -181,7 +181,7 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp
return card; return card;
} }
static ssize_t pnp_show_card_name(struct device *dmdev, static ssize_t name_show(struct device *dmdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
char *str = buf; char *str = buf;
...@@ -191,9 +191,9 @@ static ssize_t pnp_show_card_name(struct device *dmdev, ...@@ -191,9 +191,9 @@ static ssize_t pnp_show_card_name(struct device *dmdev,
return (str - buf); return (str - buf);
} }
static DEVICE_ATTR(name, S_IRUGO, pnp_show_card_name, NULL); static DEVICE_ATTR_RO(name);
static ssize_t pnp_show_card_ids(struct device *dmdev, static ssize_t card_id_show(struct device *dmdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
char *str = buf; char *str = buf;
...@@ -207,7 +207,7 @@ static ssize_t pnp_show_card_ids(struct device *dmdev, ...@@ -207,7 +207,7 @@ static ssize_t pnp_show_card_ids(struct device *dmdev,
return (str - buf); return (str - buf);
} }
static DEVICE_ATTR(card_id, S_IRUGO, pnp_show_card_ids, NULL); static DEVICE_ATTR_RO(card_id);
static int pnp_interface_attach_card(struct pnp_card *card) static int pnp_interface_attach_card(struct pnp_card *card)
{ {
......
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