mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Acked-by: Robert Jarzmik <[email protected]>
Acked-by: Sagi Grimberg <[email protected]>
Acked-by: Zhang Rui <[email protected]>
Acked-by: Harald Freudenberger <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Acked-by: Corey Minyard <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
b6b996b6cd
commit
c828a89203
15 changed files with 54 additions and 57 deletions
|
|
@ -2471,14 +2471,14 @@ static ssize_t wwid_show(struct device *dev, struct device_attribute *attr,
|
|||
serial_len, subsys->serial, model_len, subsys->model,
|
||||
head->ns_id);
|
||||
}
|
||||
static DEVICE_ATTR(wwid, S_IRUGO, wwid_show, NULL);
|
||||
static DEVICE_ATTR_RO(wwid);
|
||||
|
||||
static ssize_t nguid_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%pU\n", dev_to_ns_head(dev)->ids.nguid);
|
||||
}
|
||||
static DEVICE_ATTR(nguid, S_IRUGO, nguid_show, NULL);
|
||||
static DEVICE_ATTR_RO(nguid);
|
||||
|
||||
static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
|
|
@ -2495,21 +2495,21 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
|
|||
}
|
||||
return sprintf(buf, "%pU\n", &ids->uuid);
|
||||
}
|
||||
static DEVICE_ATTR(uuid, S_IRUGO, uuid_show, NULL);
|
||||
static DEVICE_ATTR_RO(uuid);
|
||||
|
||||
static ssize_t eui_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%8ph\n", dev_to_ns_head(dev)->ids.eui64);
|
||||
}
|
||||
static DEVICE_ATTR(eui, S_IRUGO, eui_show, NULL);
|
||||
static DEVICE_ATTR_RO(eui);
|
||||
|
||||
static ssize_t nsid_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", dev_to_ns_head(dev)->ns_id);
|
||||
}
|
||||
static DEVICE_ATTR(nsid, S_IRUGO, nsid_show, NULL);
|
||||
static DEVICE_ATTR_RO(nsid);
|
||||
|
||||
static struct attribute *nvme_ns_id_attrs[] = {
|
||||
&dev_attr_wwid.attr,
|
||||
|
|
|
|||
Loading…
Reference in a new issue