summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2017-12-19 13:15:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-09 10:33:31 -0500
commitb6b996b6cdeecf7e1646c87422e04e446ddce124 (patch)
treeef1b873db80200b159624ce2611137024abf1672
parent353c6ddaa963d453dc56ced2f3cbfd9bd57409c7 (diff)
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 <joe@perches.com> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/s390/kernel/topology.c3
-rw-r--r--arch/tile/kernel/sysfs.c2
-rw-r--r--drivers/gpu/drm/i915/i915_sysfs.c6
-rw-r--r--drivers/platform/x86/compal-laptop.c18
-rw-r--r--drivers/s390/cio/device.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c43
-rw-r--r--drivers/thermal/thermal_sysfs.c9
-rw-r--r--drivers/tty/serial/sh-sci.c2
-rw-r--r--drivers/usb/phy/phy-tahvo.c2
-rw-r--r--drivers/video/fbdev/auo_k190x.c4
-rw-r--r--drivers/video/fbdev/w100fb.c4
-rw-r--r--lib/test_firmware.c14
-rw-r--r--lib/test_kmod.c14
-rw-r--r--sound/soc/omap/mcbsp.c4
14 files changed, 48 insertions, 79 deletions
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 4d5b65e527b5..4b6e0397f66d 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -404,8 +404,7 @@ out:
404 put_online_cpus(); 404 put_online_cpus();
405 return rc ? rc : count; 405 return rc ? rc : count;
406} 406}
407static DEVICE_ATTR(dispatching, 0644, dispatching_show, 407static DEVICE_ATTR_RW(dispatching);
408 dispatching_store);
409 408
410static ssize_t cpu_polarization_show(struct device *dev, 409static ssize_t cpu_polarization_show(struct device *dev,
411 struct device_attribute *attr, char *buf) 410 struct device_attribute *attr, char *buf)
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
index 825867c53853..af5024f0fb5a 100644
--- a/arch/tile/kernel/sysfs.c
+++ b/arch/tile/kernel/sysfs.c
@@ -184,7 +184,7 @@ static ssize_t hv_stats_store(struct device *dev,
184 return n < 0 ? n : count; 184 return n < 0 ? n : count;
185} 185}
186 186
187static DEVICE_ATTR(hv_stats, 0644, hv_stats_show, hv_stats_store); 187static DEVICE_ATTR_RW(hv_stats);
188 188
189static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif) 189static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif)
190{ 190{
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 791759f632e1..3fce362ca921 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -436,9 +436,9 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
436 436
437static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL); 437static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL);
438static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL); 438static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL);
439static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store); 439static DEVICE_ATTR_RW(gt_boost_freq_mhz);
440static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store); 440static DEVICE_ATTR_RW(gt_max_freq_mhz);
441static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store); 441static DEVICE_ATTR_RW(gt_min_freq_mhz);
442 442
443static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL); 443static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL);
444 444
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 6bcb750e1865..4f9bc72f0584 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -679,18 +679,12 @@ static int bat_writeable_property(struct power_supply *psy,
679/* ============== */ 679/* ============== */
680/* Driver Globals */ 680/* Driver Globals */
681/* ============== */ 681/* ============== */
682static DEVICE_ATTR(wake_up_pme, 682static DEVICE_ATTR_RW(wake_up_pme);
683 0644, wake_up_pme_show, wake_up_pme_store); 683static DEVICE_ATTR_RW(wake_up_modem);
684static DEVICE_ATTR(wake_up_modem, 684static DEVICE_ATTR_RW(wake_up_lan);
685 0644, wake_up_modem_show, wake_up_modem_store); 685static DEVICE_ATTR_RW(wake_up_wlan);
686static DEVICE_ATTR(wake_up_lan, 686static DEVICE_ATTR_RW(wake_up_key);
687 0644, wake_up_lan_show, wake_up_lan_store); 687static DEVICE_ATTR_RW(wake_up_mouse);
688static DEVICE_ATTR(wake_up_wlan,
689 0644, wake_up_wlan_show, wake_up_wlan_store);
690static DEVICE_ATTR(wake_up_key,
691 0644, wake_up_key_show, wake_up_key_store);
692static DEVICE_ATTR(wake_up_mouse,
693 0644, wake_up_mouse_show, wake_up_mouse_store);
694 688
695static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL); 689static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL);
696static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL); 690static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL);
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,
600static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); 600static DEVICE_ATTR(devtype, 0444, devtype_show, NULL);
601static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); 601static DEVICE_ATTR(cutype, 0444, cutype_show, NULL);
602static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); 602static DEVICE_ATTR(modalias, 0444, modalias_show, NULL);
603static DEVICE_ATTR(online, 0644, online_show, online_store); 603static DEVICE_ATTR_RW(online);
604static DEVICE_ATTR(availability, 0444, available_show, NULL); 604static DEVICE_ATTR(availability, 0444, available_show, NULL);
605static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); 605static DEVICE_ATTR(logging, 0200, NULL, initiate_logging);
606static DEVICE_ATTR(vpm, 0444, vpm_show, NULL); 606static DEVICE_ATTR(vpm, 0444, vpm_show, NULL);
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 82f6e219ee34..c9f54de2aefd 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2485,8 +2485,7 @@ lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr,
2485 "reinit adapter - %d\n", stat2); 2485 "reinit adapter - %d\n", stat2);
2486 return (stat1 || stat2) ? -EIO : count; 2486 return (stat1 || stat2) ? -EIO : count;
2487} 2487}
2488static DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR, 2488static DEVICE_ATTR_RW(lpfc_soft_wwpn);
2489 lpfc_soft_wwpn_show, lpfc_soft_wwpn_store);
2490 2489
2491/** 2490/**
2492 * lpfc_soft_wwnn_show - Return the cfg soft ww node name for the adapter 2491 * lpfc_soft_wwnn_show - Return the cfg soft ww node name for the adapter
@@ -2549,8 +2548,7 @@ lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr,
2549 2548
2550 return count; 2549 return count;
2551} 2550}
2552static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR, 2551static DEVICE_ATTR_RW(lpfc_soft_wwnn);
2553 lpfc_soft_wwnn_show, lpfc_soft_wwnn_store);
2554 2552
2555/** 2553/**
2556 * lpfc_oas_tgt_show - Return wwpn of target whose luns maybe enabled for 2554 * lpfc_oas_tgt_show - Return wwpn of target whose luns maybe enabled for
@@ -3068,8 +3066,7 @@ MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:"
3068 " 1 - poll with interrupts enabled" 3066 " 1 - poll with interrupts enabled"
3069 " 3 - poll and disable FCP ring interrupts"); 3067 " 3 - poll and disable FCP ring interrupts");
3070 3068
3071static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR, 3069static DEVICE_ATTR_RW(lpfc_poll);
3072 lpfc_poll_show, lpfc_poll_store);
3073 3070
3074int lpfc_no_hba_reset_cnt; 3071int lpfc_no_hba_reset_cnt;
3075unsigned long lpfc_no_hba_reset[MAX_HBAS_NO_RESET] = { 3072unsigned long lpfc_no_hba_reset[MAX_HBAS_NO_RESET] = {
@@ -3302,8 +3299,7 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
3302 3299
3303lpfc_vport_param_store(nodev_tmo) 3300lpfc_vport_param_store(nodev_tmo)
3304 3301
3305static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR, 3302static DEVICE_ATTR_RW(lpfc_nodev_tmo);
3306 lpfc_nodev_tmo_show, lpfc_nodev_tmo_store);
3307 3303
3308/* 3304/*
3309# lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that 3305# lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that
@@ -3352,8 +3348,7 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
3352} 3348}
3353 3349
3354lpfc_vport_param_store(devloss_tmo) 3350lpfc_vport_param_store(devloss_tmo)
3355static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, 3351static DEVICE_ATTR_RW(lpfc_devloss_tmo);
3356 lpfc_devloss_tmo_show, lpfc_devloss_tmo_store);
3357 3352
3358/* 3353/*
3359 * lpfc_suppress_rsp: Enable suppress rsp feature is firmware supports it 3354 * lpfc_suppress_rsp: Enable suppress rsp feature is firmware supports it
@@ -3545,8 +3540,7 @@ lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
3545 return 0; 3540 return 0;
3546} 3541}
3547lpfc_vport_param_store(restrict_login); 3542lpfc_vport_param_store(restrict_login);
3548static DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR, 3543static DEVICE_ATTR_RW(lpfc_restrict_login);
3549 lpfc_restrict_login_show, lpfc_restrict_login_store);
3550 3544
3551/* 3545/*
3552# Some disk devices have a "select ID" or "select Target" capability. 3546# Some disk devices have a "select ID" or "select Target" capability.
@@ -3660,8 +3654,7 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
3660} 3654}
3661 3655
3662lpfc_param_show(topology) 3656lpfc_param_show(topology)
3663static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, 3657static DEVICE_ATTR_RW(lpfc_topology);
3664 lpfc_topology_show, lpfc_topology_store);
3665 3658
3666/** 3659/**
3667 * lpfc_static_vport_show: Read callback function for 3660 * lpfc_static_vport_show: Read callback function for
@@ -3919,8 +3912,7 @@ lpfc_stat_data_ctrl_show(struct device *dev, struct device_attribute *attr,
3919/* 3912/*
3920 * Sysfs attribute to control the statistical data collection. 3913 * Sysfs attribute to control the statistical data collection.
3921 */ 3914 */
3922static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR, 3915static DEVICE_ATTR_RW(lpfc_stat_data_ctrl);
3923 lpfc_stat_data_ctrl_show, lpfc_stat_data_ctrl_store);
3924 3916
3925/* 3917/*
3926 * lpfc_drvr_stat_data: sysfs attr to get driver statistical data. 3918 * lpfc_drvr_stat_data: sysfs attr to get driver statistical data.
@@ -4159,8 +4151,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val)
4159 return -EINVAL; 4151 return -EINVAL;
4160} 4152}
4161 4153
4162static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR, 4154static DEVICE_ATTR_RW(lpfc_link_speed);
4163 lpfc_link_speed_show, lpfc_link_speed_store);
4164 4155
4165/* 4156/*
4166# lpfc_aer_support: Support PCIe device Advanced Error Reporting (AER) 4157# lpfc_aer_support: Support PCIe device Advanced Error Reporting (AER)
@@ -4253,8 +4244,7 @@ lpfc_aer_support_store(struct device *dev, struct device_attribute *attr,
4253 return rc; 4244 return rc;
4254} 4245}
4255 4246
4256static DEVICE_ATTR(lpfc_aer_support, S_IRUGO | S_IWUSR, 4247static DEVICE_ATTR_RW(lpfc_aer_support);
4257 lpfc_aer_support_show, lpfc_aer_support_store);
4258 4248
4259/** 4249/**
4260 * lpfc_aer_cleanup_state - Clean up aer state to the aer enabled device 4250 * lpfc_aer_cleanup_state - Clean up aer state to the aer enabled device
@@ -4401,8 +4391,7 @@ LPFC_ATTR(sriov_nr_virtfn, LPFC_DEF_VFN_PER_PFN, 0, LPFC_MAX_VFN_PER_PFN,
4401 "Enable PCIe device SR-IOV virtual fn"); 4391 "Enable PCIe device SR-IOV virtual fn");
4402 4392
4403lpfc_param_show(sriov_nr_virtfn) 4393lpfc_param_show(sriov_nr_virtfn)
4404static DEVICE_ATTR(lpfc_sriov_nr_virtfn, S_IRUGO | S_IWUSR, 4394static DEVICE_ATTR_RW(lpfc_sriov_nr_virtfn);
4405 lpfc_sriov_nr_virtfn_show, lpfc_sriov_nr_virtfn_store);
4406 4395
4407/** 4396/**
4408 * lpfc_request_firmware_store - Request for Linux generic firmware upgrade 4397 * lpfc_request_firmware_store - Request for Linux generic firmware upgrade
@@ -4576,8 +4565,7 @@ lpfc_fcp_imax_init(struct lpfc_hba *phba, int val)
4576 return 0; 4565 return 0;
4577} 4566}
4578 4567
4579static DEVICE_ATTR(lpfc_fcp_imax, S_IRUGO | S_IWUSR, 4568static DEVICE_ATTR_RW(lpfc_fcp_imax);
4580 lpfc_fcp_imax_show, lpfc_fcp_imax_store);
4581 4569
4582/* 4570/*
4583 * lpfc_auto_imax: Controls Auto-interrupt coalescing values support. 4571 * lpfc_auto_imax: Controls Auto-interrupt coalescing values support.
@@ -4737,8 +4725,7 @@ lpfc_fcp_cpu_map_init(struct lpfc_hba *phba, int val)
4737 return 0; 4725 return 0;
4738} 4726}
4739 4727
4740static DEVICE_ATTR(lpfc_fcp_cpu_map, S_IRUGO | S_IWUSR, 4728static DEVICE_ATTR_RW(lpfc_fcp_cpu_map);
4741 lpfc_fcp_cpu_map_show, lpfc_fcp_cpu_map_store);
4742 4729
4743/* 4730/*
4744# lpfc_fcp_class: Determines FC class to use for the FCP protocol. 4731# lpfc_fcp_class: Determines FC class to use for the FCP protocol.
@@ -4824,9 +4811,7 @@ lpfc_max_scsicmpl_time_set(struct lpfc_vport *vport, int val)
4824 return 0; 4811 return 0;
4825} 4812}
4826lpfc_vport_param_store(max_scsicmpl_time); 4813lpfc_vport_param_store(max_scsicmpl_time);
4827static DEVICE_ATTR(lpfc_max_scsicmpl_time, S_IRUGO | S_IWUSR, 4814static DEVICE_ATTR_RW(lpfc_max_scsicmpl_time);
4828 lpfc_max_scsicmpl_time_show,
4829 lpfc_max_scsicmpl_time_store);
4830 4815
4831/* 4816/*
4832# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value 4817# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index fb80c96d8f73..c008af7fb480 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -398,14 +398,13 @@ create_s32_tzp_attr(offset);
398 */ 398 */
399static DEVICE_ATTR(type, 0444, type_show, NULL); 399static DEVICE_ATTR(type, 0444, type_show, NULL);
400static DEVICE_ATTR(temp, 0444, temp_show, NULL); 400static DEVICE_ATTR(temp, 0444, temp_show, NULL);
401static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store); 401static DEVICE_ATTR_RW(policy);
402static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL); 402static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL);
403static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, 403static DEVICE_ATTR_RW(sustainable_power);
404 sustainable_power_store);
405 404
406/* These thermal zone device attributes are created based on conditions */ 405/* These thermal zone device attributes are created based on conditions */
407static DEVICE_ATTR(mode, 0644, mode_show, mode_store); 406static DEVICE_ATTR_RW(mode);
408static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); 407static DEVICE_ATTR_RW(passive);
409 408
410/* These attributes are unconditionally added to a thermal zone */ 409/* These attributes are unconditionally added to a thermal zone */
411static struct attribute *thermal_zone_dev_attrs[] = { 410static struct attribute *thermal_zone_dev_attrs[] = {
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index d9f399c4e90c..7257c078e155 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1144,7 +1144,7 @@ static ssize_t rx_fifo_timeout_store(struct device *dev,
1144 return count; 1144 return count;
1145} 1145}
1146 1146
1147static DEVICE_ATTR(rx_fifo_timeout, 0644, rx_fifo_timeout_show, rx_fifo_timeout_store); 1147static DEVICE_ATTR_RW(rx_fifo_timeout);
1148 1148
1149 1149
1150#ifdef CONFIG_SERIAL_SH_SCI_DMA 1150#ifdef CONFIG_SERIAL_SH_SCI_DMA
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index b3ce42edb373..7f7c5c82420d 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -310,7 +310,7 @@ static ssize_t otg_mode_store(struct device *device,
310 310
311 return r; 311 return r;
312} 312}
313static DEVICE_ATTR(otg_mode, 0644, otg_mode_show, otg_mode_store); 313static DEVICE_ATTR_RW(otg_mode);
314 314
315static struct attribute *tahvo_attributes[] = { 315static struct attribute *tahvo_attributes[] = {
316 &dev_attr_vbus.attr, 316 &dev_attr_vbus.attr,
diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
index 0d06038324e0..1e383c547633 100644
--- a/drivers/video/fbdev/auo_k190x.c
+++ b/drivers/video/fbdev/auo_k190x.c
@@ -708,8 +708,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
708 return sprintf(buf, "%d\n", temp); 708 return sprintf(buf, "%d\n", temp);
709} 709}
710 710
711static DEVICE_ATTR(update_mode, 0644, update_mode_show, update_mode_store); 711static DEVICE_ATTR_RW(update_mode);
712static DEVICE_ATTR(flash, 0644, flash_show, flash_store); 712static DEVICE_ATTR_RW(flash);
713static DEVICE_ATTR(temp, 0644, temp_show, NULL); 713static DEVICE_ATTR(temp, 0644, temp_show, NULL);
714 714
715static struct attribute *auok190x_attributes[] = { 715static struct attribute *auok190x_attributes[] = {
diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c
index d570e19a2864..035ff6e02894 100644
--- a/drivers/video/fbdev/w100fb.c
+++ b/drivers/video/fbdev/w100fb.c
@@ -110,7 +110,7 @@ static ssize_t flip_store(struct device *dev, struct device_attribute *attr, con
110 return count; 110 return count;
111} 111}
112 112
113static DEVICE_ATTR(flip, 0644, flip_show, flip_store); 113static DEVICE_ATTR_RW(flip);
114 114
115static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 115static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
116{ 116{
@@ -166,7 +166,7 @@ static ssize_t fastpllclk_store(struct device *dev, struct device_attribute *att
166 return count; 166 return count;
167} 167}
168 168
169static DEVICE_ATTR(fastpllclk, 0644, fastpllclk_show, fastpllclk_store); 169static DEVICE_ATTR_RW(fastpllclk);
170 170
171/* 171/*
172 * Some touchscreens need hsync information from the video driver to 172 * Some touchscreens need hsync information from the video driver to
diff --git a/lib/test_firmware.c b/lib/test_firmware.c
index 64a4c76cba2b..964784dc1602 100644
--- a/lib/test_firmware.c
+++ b/lib/test_firmware.c
@@ -359,7 +359,7 @@ static ssize_t config_name_show(struct device *dev,
359{ 359{
360 return config_test_show_str(buf, test_fw_config->name); 360 return config_test_show_str(buf, test_fw_config->name);
361} 361}
362static DEVICE_ATTR(config_name, 0644, config_name_show, config_name_store); 362static DEVICE_ATTR_RW(config_name);
363 363
364static ssize_t config_num_requests_store(struct device *dev, 364static ssize_t config_num_requests_store(struct device *dev,
365 struct device_attribute *attr, 365 struct device_attribute *attr,
@@ -388,8 +388,7 @@ static ssize_t config_num_requests_show(struct device *dev,
388{ 388{
389 return test_dev_config_show_u8(buf, test_fw_config->num_requests); 389 return test_dev_config_show_u8(buf, test_fw_config->num_requests);
390} 390}
391static DEVICE_ATTR(config_num_requests, 0644, config_num_requests_show, 391static DEVICE_ATTR_RW(config_num_requests);
392 config_num_requests_store);
393 392
394static ssize_t config_sync_direct_store(struct device *dev, 393static ssize_t config_sync_direct_store(struct device *dev,
395 struct device_attribute *attr, 394 struct device_attribute *attr,
@@ -411,8 +410,7 @@ static ssize_t config_sync_direct_show(struct device *dev,
411{ 410{
412 return test_dev_config_show_bool(buf, test_fw_config->sync_direct); 411 return test_dev_config_show_bool(buf, test_fw_config->sync_direct);
413} 412}
414static DEVICE_ATTR(config_sync_direct, 0644, config_sync_direct_show, 413static DEVICE_ATTR_RW(config_sync_direct);
415 config_sync_direct_store);
416 414
417static ssize_t config_send_uevent_store(struct device *dev, 415static ssize_t config_send_uevent_store(struct device *dev,
418 struct device_attribute *attr, 416 struct device_attribute *attr,
@@ -428,8 +426,7 @@ static ssize_t config_send_uevent_show(struct device *dev,
428{ 426{
429 return test_dev_config_show_bool(buf, test_fw_config->send_uevent); 427 return test_dev_config_show_bool(buf, test_fw_config->send_uevent);
430} 428}
431static DEVICE_ATTR(config_send_uevent, 0644, config_send_uevent_show, 429static DEVICE_ATTR_RW(config_send_uevent);
432 config_send_uevent_store);
433 430
434static ssize_t config_read_fw_idx_store(struct device *dev, 431static ssize_t config_read_fw_idx_store(struct device *dev,
435 struct device_attribute *attr, 432 struct device_attribute *attr,
@@ -445,8 +442,7 @@ static ssize_t config_read_fw_idx_show(struct device *dev,
445{ 442{
446 return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx); 443 return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx);
447} 444}
448static DEVICE_ATTR(config_read_fw_idx, 0644, config_read_fw_idx_show, 445static DEVICE_ATTR_RW(config_read_fw_idx);
449 config_read_fw_idx_store);
450 446
451 447
452static ssize_t trigger_request_store(struct device *dev, 448static ssize_t trigger_request_store(struct device *dev,
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 337f408b4de6..e372b97eee13 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -694,8 +694,7 @@ static ssize_t config_test_driver_show(struct device *dev,
694 return config_test_show_str(&test_dev->config_mutex, buf, 694 return config_test_show_str(&test_dev->config_mutex, buf,
695 config->test_driver); 695 config->test_driver);
696} 696}
697static DEVICE_ATTR(config_test_driver, 0644, config_test_driver_show, 697static DEVICE_ATTR_RW(config_test_driver);
698 config_test_driver_store);
699 698
700static ssize_t config_test_fs_store(struct device *dev, 699static ssize_t config_test_fs_store(struct device *dev,
701 struct device_attribute *attr, 700 struct device_attribute *attr,
@@ -726,8 +725,7 @@ static ssize_t config_test_fs_show(struct device *dev,
726 return config_test_show_str(&test_dev->config_mutex, buf, 725 return config_test_show_str(&test_dev->config_mutex, buf,
727 config->test_fs); 726 config->test_fs);
728} 727}
729static DEVICE_ATTR(config_test_fs, 0644, config_test_fs_show, 728static DEVICE_ATTR_RW(config_test_fs);
730 config_test_fs_store);
731 729
732static int trigger_config_run_type(struct kmod_test_device *test_dev, 730static int trigger_config_run_type(struct kmod_test_device *test_dev,
733 enum kmod_test_case test_case, 731 enum kmod_test_case test_case,
@@ -1012,8 +1010,7 @@ static ssize_t config_num_threads_show(struct device *dev,
1012 1010
1013 return test_dev_config_show_int(test_dev, buf, config->num_threads); 1011 return test_dev_config_show_int(test_dev, buf, config->num_threads);
1014} 1012}
1015static DEVICE_ATTR(config_num_threads, 0644, config_num_threads_show, 1013static DEVICE_ATTR_RW(config_num_threads);
1016 config_num_threads_store);
1017 1014
1018static ssize_t config_test_case_store(struct device *dev, 1015static ssize_t config_test_case_store(struct device *dev,
1019 struct device_attribute *attr, 1016 struct device_attribute *attr,
@@ -1037,8 +1034,7 @@ static ssize_t config_test_case_show(struct device *dev,
1037 1034
1038 return test_dev_config_show_uint(test_dev, buf, config->test_case); 1035 return test_dev_config_show_uint(test_dev, buf, config->test_case);
1039} 1036}
1040static DEVICE_ATTR(config_test_case, 0644, config_test_case_show, 1037static DEVICE_ATTR_RW(config_test_case);
1041 config_test_case_store);
1042 1038
1043static ssize_t test_result_show(struct device *dev, 1039static ssize_t test_result_show(struct device *dev,
1044 struct device_attribute *attr, 1040 struct device_attribute *attr,
@@ -1049,7 +1045,7 @@ static ssize_t test_result_show(struct device *dev,
1049 1045
1050 return test_dev_config_show_int(test_dev, buf, config->test_result); 1046 return test_dev_config_show_int(test_dev, buf, config->test_result);
1051} 1047}
1052static DEVICE_ATTR(test_result, 0644, test_result_show, test_result_store); 1048static DEVICE_ATTR_RW(test_result);
1053 1049
1054#define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr 1050#define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr
1055 1051
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index 7a54e3083203..79d4dc785e5c 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -854,7 +854,7 @@ unlock:
854 return size; 854 return size;
855} 855}
856 856
857static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store); 857static DEVICE_ATTR_RW(dma_op_mode);
858 858
859static const struct attribute *additional_attrs[] = { 859static const struct attribute *additional_attrs[] = {
860 &dev_attr_max_tx_thres.attr, 860 &dev_attr_max_tx_thres.attr,
@@ -923,7 +923,7 @@ out:
923 return size; 923 return size;
924} 924}
925 925
926static DEVICE_ATTR(st_taps, 0644, st_taps_show, st_taps_store); 926static DEVICE_ATTR_RW(st_taps);
927 927
928static const struct attribute *sidetone_attrs[] = { 928static const struct attribute *sidetone_attrs[] = {
929 &dev_attr_st_taps.attr, 929 &dev_attr_st_taps.attr,