From b6b996b6cdeecf7e1646c87422e04e446ddce124 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 19 Dec 2017 10:15:07 -0800 Subject: treewide: Use DEVICE_ATTR_RW Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible. Done with perl script: $ git grep -w --name-only DEVICE_ATTR | \ xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(\s*S_IRUGO\s*\|\s*S_IWUSR|\s*S_IWUSR\s*\|\s*S_IRUGO\s*|\s*0644\s*)\)?\s*,\s*\1_show\s*,\s*\1_store\s*\)/DEVICE_ATTR_RW(\1)/g; print;}' Signed-off-by: Joe Perches Acked-by: Felipe Balbi Acked-by: Andy Shevchenko Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Zhang Rui Acked-by: Jarkko Nikula Acked-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/s390') diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 75a245f38e2e..6eefb67b31f3 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -600,7 +600,7 @@ static ssize_t vpm_show(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); -static DEVICE_ATTR(online, 0644, online_show, online_store); +static DEVICE_ATTR_RW(online); static DEVICE_ATTR(availability, 0444, available_show, NULL); static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); static DEVICE_ATTR(vpm, 0444, vpm_show, NULL); -- cgit From c828a8920307185b7194b575731e8387c99a5a67 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 19 Dec 2017 10:15:08 -0800 Subject: treewide: Use DEVICE_ATTR_RO Convert DEVICE_ATTR uses to DEVICE_ATTR_RO where possible. Done with perl script: $ git grep -w --name-only DEVICE_ATTR | \ xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IRUGO\s*|\s*0444\s*)\)?\s*,\s*\1_show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(\1)/g; print;}' Signed-off-by: Joe Perches Acked-by: Rafael J. Wysocki Acked-by: Robert Jarzmik Acked-by: Sagi Grimberg Acked-by: Zhang Rui Acked-by: Harald Freudenberger Acked-by: Jani Nikula Acked-by: Corey Minyard Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/css.c | 8 ++++---- drivers/s390/cio/device.c | 8 ++++---- drivers/s390/crypto/ap_card.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 0f11dce6e224..9263a0fb3858 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -268,7 +268,7 @@ static ssize_t type_show(struct device *dev, struct device_attribute *attr, return sprintf(buf, "%01x\n", sch->st); } -static DEVICE_ATTR(type, 0444, type_show, NULL); +static DEVICE_ATTR_RO(type); static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -278,7 +278,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, return sprintf(buf, "css:t%01X\n", sch->st); } -static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); +static DEVICE_ATTR_RO(modalias); static struct attribute *subch_attrs[] = { &dev_attr_type.attr, @@ -315,7 +315,7 @@ static ssize_t chpids_show(struct device *dev, ret += sprintf(buf + ret, "\n"); return ret; } -static DEVICE_ATTR(chpids, 0444, chpids_show, NULL); +static DEVICE_ATTR_RO(chpids); static ssize_t pimpampom_show(struct device *dev, struct device_attribute *attr, @@ -327,7 +327,7 @@ static ssize_t pimpampom_show(struct device *dev, return sprintf(buf, "%02x %02x %02x\n", pmcw->pim, pmcw->pam, pmcw->pom); } -static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL); +static DEVICE_ATTR_RO(pimpampom); static struct attribute *io_subchannel_type_attrs[] = { &dev_attr_chpids.attr, diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 6eefb67b31f3..f50ea035aa9b 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -597,13 +597,13 @@ static ssize_t vpm_show(struct device *dev, struct device_attribute *attr, return sprintf(buf, "%02x\n", sch->vpm); } -static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); -static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); -static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); +static DEVICE_ATTR_RO(devtype); +static DEVICE_ATTR_RO(cutype); +static DEVICE_ATTR_RO(modalias); static DEVICE_ATTR_RW(online); static DEVICE_ATTR(availability, 0444, available_show, NULL); static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); -static DEVICE_ATTR(vpm, 0444, vpm_show, NULL); +static DEVICE_ATTR_RO(vpm); static struct attribute *io_subchannel_attrs[] = { &dev_attr_logging.attr, diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c index 97a8cf578116..2c726df210f6 100644 --- a/drivers/s390/crypto/ap_card.c +++ b/drivers/s390/crypto/ap_card.c @@ -57,7 +57,7 @@ static ssize_t ap_functions_show(struct device *dev, return snprintf(buf, PAGE_SIZE, "0x%08X\n", ac->functions); } -static DEVICE_ATTR(ap_functions, 0444, ap_functions_show, NULL); +static DEVICE_ATTR_RO(ap_functions); static ssize_t ap_req_count_show(struct device *dev, struct device_attribute *attr, -- cgit