Skip to content

Commit 6cbaefb

Browse files
JoePerchesgregkh
authored andcommitted
treewide: Use DEVICE_ATTR_WO
Convert DEVICE_ATTR uses to DEVICE_ATTR_WO 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_IWUSR\s*|\s*0200\s*)\)?\s*,\s*NULL\s*,\s*\s_store\s*\)/DEVICE_ATTR_WO(\1)/g; print;}' Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c828a89 commit 6cbaefb

7 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎arch/s390/kernel/smp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ static ssize_t __ref rescan_store(struct device *dev,
11511151
rc = smp_rescan_cpus();
11521152
return rc ? rc : count;
11531153
}
1154-
static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
1154+
static DEVICE_ATTR_WO(rescan);
11551155
#endif /* CONFIG_HOTPLUG_CPU */
11561156

11571157
static int __init s390_smp_init(void)

‎arch/x86/kernel/cpu/microcode/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static ssize_t pf_show(struct device *dev,
560560
return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
561561
}
562562

563-
static DEVICE_ATTR(reload, 0200, NULL, reload_store);
563+
static DEVICE_ATTR_WO(reload);
564564
static DEVICE_ATTR(version, 0400, version_show, NULL);
565565
static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL);
566566

‎drivers/input/touchscreen/elants_i2c.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ static ssize_t show_iap_mode(struct device *dev,
999999
"Normal" : "Recovery");
10001000
}
10011001

1002-
static DEVICE_ATTR(calibrate, S_IWUSR, NULL, calibrate_store);
1002+
static DEVICE_ATTR_WO(calibrate);
10031003
static DEVICE_ATTR(iap_mode, S_IRUGO, show_iap_mode, NULL);
10041004
static DEVICE_ATTR(update_fw, S_IWUSR, NULL, write_update_fw);
10051005

‎drivers/net/ethernet/ibm/ibmvnic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4411,7 +4411,7 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr,
44114411
return count;
44124412
}
44134413

4414-
static DEVICE_ATTR(failover, 0200, NULL, failover_store);
4414+
static DEVICE_ATTR_WO(failover);
44154415

44164416
static unsigned long ibmvnic_get_desired_dma(struct vio_dev *vdev)
44174417
{

‎drivers/net/wimax/i2400m/sysfs.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ ssize_t i2400m_idle_timeout_store(struct device *dev,
6565
}
6666

6767
static
68-
DEVICE_ATTR(i2400m_idle_timeout, S_IWUSR,
69-
NULL, i2400m_idle_timeout_store);
68+
DEVICE_ATTR_WO(i2400m_idle_timeout);
7069

7170
static
7271
struct attribute *i2400m_dev_attrs[] = {

‎drivers/scsi/lpfc/lpfc_attr.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,8 +2384,7 @@ lpfc_soft_wwn_enable_store(struct device *dev, struct device_attribute *attr,
23842384

23852385
return count;
23862386
}
2387-
static DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL,
2388-
lpfc_soft_wwn_enable_store);
2387+
static DEVICE_ATTR_WO(lpfc_soft_wwn_enable);
23892388

23902389
/**
23912390
* lpfc_soft_wwpn_show - Return the cfg soft ww port name of the adapter

‎drivers/thermal/thermal_sysfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
317317

318318
return ret ? ret : count;
319319
}
320-
static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);
320+
static DEVICE_ATTR_WO(emul_temp);
321321
#endif
322322

323323
static ssize_t

0 commit comments

Comments
 (0)