diff options
author | Joe Perches <joe@perches.com> | 2017-12-19 13:15:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 10:33:31 -0500 |
commit | b6b996b6cdeecf7e1646c87422e04e446ddce124 (patch) | |
tree | ef1b873db80200b159624ce2611137024abf1672 | |
parent | 353c6ddaa963d453dc56ced2f3cbfd9bd57409c7 (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.c | 3 | ||||
-rw-r--r-- | arch/tile/kernel/sysfs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_sysfs.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/compal-laptop.c | 18 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 43 | ||||
-rw-r--r-- | drivers/thermal/thermal_sysfs.c | 9 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 2 | ||||
-rw-r--r-- | drivers/usb/phy/phy-tahvo.c | 2 | ||||
-rw-r--r-- | drivers/video/fbdev/auo_k190x.c | 4 | ||||
-rw-r--r-- | drivers/video/fbdev/w100fb.c | 4 | ||||
-rw-r--r-- | lib/test_firmware.c | 14 | ||||
-rw-r--r-- | lib/test_kmod.c | 14 | ||||
-rw-r--r-- | sound/soc/omap/mcbsp.c | 4 |
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 | } |
407 | static DEVICE_ATTR(dispatching, 0644, dispatching_show, | 407 | static DEVICE_ATTR_RW(dispatching); |
408 | dispatching_store); | ||
409 | 408 | ||
410 | static ssize_t cpu_polarization_show(struct device *dev, | 409 | static 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 | ||
187 | static DEVICE_ATTR(hv_stats, 0644, hv_stats_show, hv_stats_store); | 187 | static DEVICE_ATTR_RW(hv_stats); |
188 | 188 | ||
189 | static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif) | 189 | static 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 | ||
437 | static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL); | 437 | static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL); |
438 | static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL); | 438 | static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL); |
439 | static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store); | 439 | static DEVICE_ATTR_RW(gt_boost_freq_mhz); |
440 | static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store); | 440 | static DEVICE_ATTR_RW(gt_max_freq_mhz); |
441 | static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store); | 441 | static DEVICE_ATTR_RW(gt_min_freq_mhz); |
442 | 442 | ||
443 | static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL); | 443 | static 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 | /* ============== */ |
682 | static DEVICE_ATTR(wake_up_pme, | 682 | static DEVICE_ATTR_RW(wake_up_pme); |
683 | 0644, wake_up_pme_show, wake_up_pme_store); | 683 | static DEVICE_ATTR_RW(wake_up_modem); |
684 | static DEVICE_ATTR(wake_up_modem, | 684 | static DEVICE_ATTR_RW(wake_up_lan); |
685 | 0644, wake_up_modem_show, wake_up_modem_store); | 685 | static DEVICE_ATTR_RW(wake_up_wlan); |
686 | static DEVICE_ATTR(wake_up_lan, | 686 | static DEVICE_ATTR_RW(wake_up_key); |
687 | 0644, wake_up_lan_show, wake_up_lan_store); | 687 | static DEVICE_ATTR_RW(wake_up_mouse); |
688 | static DEVICE_ATTR(wake_up_wlan, | ||
689 | 0644, wake_up_wlan_show, wake_up_wlan_store); | ||
690 | static DEVICE_ATTR(wake_up_key, | ||
691 | 0644, wake_up_key_show, wake_up_key_store); | ||
692 | static DEVICE_ATTR(wake_up_mouse, | ||
693 | 0644, wake_up_mouse_show, wake_up_mouse_store); | ||
694 | 688 | ||
695 | static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL); | 689 | static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL); |
696 | static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL); | 690 | static 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, | |||
600 | static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); | 600 | static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); |
601 | static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); | 601 | static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); |
602 | static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); | 602 | static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); |
603 | static DEVICE_ATTR(online, 0644, online_show, online_store); | 603 | static DEVICE_ATTR_RW(online); |
604 | static DEVICE_ATTR(availability, 0444, available_show, NULL); | 604 | static DEVICE_ATTR(availability, 0444, available_show, NULL); |
605 | static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); | 605 | static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); |
606 | static DEVICE_ATTR(vpm, 0444, vpm_show, NULL); | 606 | static 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 | } |
2488 | static DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR, | 2488 | static 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 | } |
2552 | static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR, | 2551 | static 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 | ||
3071 | static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR, | 3069 | static DEVICE_ATTR_RW(lpfc_poll); |
3072 | lpfc_poll_show, lpfc_poll_store); | ||
3073 | 3070 | ||
3074 | int lpfc_no_hba_reset_cnt; | 3071 | int lpfc_no_hba_reset_cnt; |
3075 | unsigned long lpfc_no_hba_reset[MAX_HBAS_NO_RESET] = { | 3072 | unsigned 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 | ||
3303 | lpfc_vport_param_store(nodev_tmo) | 3300 | lpfc_vport_param_store(nodev_tmo) |
3304 | 3301 | ||
3305 | static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR, | 3302 | static 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 | ||
3354 | lpfc_vport_param_store(devloss_tmo) | 3350 | lpfc_vport_param_store(devloss_tmo) |
3355 | static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, | 3351 | static 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 | } |
3547 | lpfc_vport_param_store(restrict_login); | 3542 | lpfc_vport_param_store(restrict_login); |
3548 | static DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR, | 3543 | static 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 | ||
3662 | lpfc_param_show(topology) | 3656 | lpfc_param_show(topology) |
3663 | static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, | 3657 | static 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 | */ |
3922 | static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR, | 3915 | static 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 | ||
4162 | static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR, | 4154 | static 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 | ||
4256 | static DEVICE_ATTR(lpfc_aer_support, S_IRUGO | S_IWUSR, | 4247 | static 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 | ||
4403 | lpfc_param_show(sriov_nr_virtfn) | 4393 | lpfc_param_show(sriov_nr_virtfn) |
4404 | static DEVICE_ATTR(lpfc_sriov_nr_virtfn, S_IRUGO | S_IWUSR, | 4394 | static 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 | ||
4579 | static DEVICE_ATTR(lpfc_fcp_imax, S_IRUGO | S_IWUSR, | 4568 | static 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 | ||
4740 | static DEVICE_ATTR(lpfc_fcp_cpu_map, S_IRUGO | S_IWUSR, | 4728 | static 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 | } |
4826 | lpfc_vport_param_store(max_scsicmpl_time); | 4813 | lpfc_vport_param_store(max_scsicmpl_time); |
4827 | static DEVICE_ATTR(lpfc_max_scsicmpl_time, S_IRUGO | S_IWUSR, | 4814 | static 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 | */ |
399 | static DEVICE_ATTR(type, 0444, type_show, NULL); | 399 | static DEVICE_ATTR(type, 0444, type_show, NULL); |
400 | static DEVICE_ATTR(temp, 0444, temp_show, NULL); | 400 | static DEVICE_ATTR(temp, 0444, temp_show, NULL); |
401 | static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store); | 401 | static DEVICE_ATTR_RW(policy); |
402 | static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL); | 402 | static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL); |
403 | static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, | 403 | static 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 */ |
407 | static DEVICE_ATTR(mode, 0644, mode_show, mode_store); | 406 | static DEVICE_ATTR_RW(mode); |
408 | static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); | 407 | static 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 */ |
411 | static struct attribute *thermal_zone_dev_attrs[] = { | 410 | static 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 | ||
1147 | static DEVICE_ATTR(rx_fifo_timeout, 0644, rx_fifo_timeout_show, rx_fifo_timeout_store); | 1147 | static 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 | } |
313 | static DEVICE_ATTR(otg_mode, 0644, otg_mode_show, otg_mode_store); | 313 | static DEVICE_ATTR_RW(otg_mode); |
314 | 314 | ||
315 | static struct attribute *tahvo_attributes[] = { | 315 | static 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 | ||
711 | static DEVICE_ATTR(update_mode, 0644, update_mode_show, update_mode_store); | 711 | static DEVICE_ATTR_RW(update_mode); |
712 | static DEVICE_ATTR(flash, 0644, flash_show, flash_store); | 712 | static DEVICE_ATTR_RW(flash); |
713 | static DEVICE_ATTR(temp, 0644, temp_show, NULL); | 713 | static DEVICE_ATTR(temp, 0644, temp_show, NULL); |
714 | 714 | ||
715 | static struct attribute *auok190x_attributes[] = { | 715 | static 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 | ||
113 | static DEVICE_ATTR(flip, 0644, flip_show, flip_store); | 113 | static DEVICE_ATTR_RW(flip); |
114 | 114 | ||
115 | static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 115 | static 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 | ||
169 | static DEVICE_ATTR(fastpllclk, 0644, fastpllclk_show, fastpllclk_store); | 169 | static 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 | } |
362 | static DEVICE_ATTR(config_name, 0644, config_name_show, config_name_store); | 362 | static DEVICE_ATTR_RW(config_name); |
363 | 363 | ||
364 | static ssize_t config_num_requests_store(struct device *dev, | 364 | static 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 | } |
391 | static DEVICE_ATTR(config_num_requests, 0644, config_num_requests_show, | 391 | static DEVICE_ATTR_RW(config_num_requests); |
392 | config_num_requests_store); | ||
393 | 392 | ||
394 | static ssize_t config_sync_direct_store(struct device *dev, | 393 | static 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 | } |
414 | static DEVICE_ATTR(config_sync_direct, 0644, config_sync_direct_show, | 413 | static DEVICE_ATTR_RW(config_sync_direct); |
415 | config_sync_direct_store); | ||
416 | 414 | ||
417 | static ssize_t config_send_uevent_store(struct device *dev, | 415 | static 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 | } |
431 | static DEVICE_ATTR(config_send_uevent, 0644, config_send_uevent_show, | 429 | static DEVICE_ATTR_RW(config_send_uevent); |
432 | config_send_uevent_store); | ||
433 | 430 | ||
434 | static ssize_t config_read_fw_idx_store(struct device *dev, | 431 | static 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 | } |
448 | static DEVICE_ATTR(config_read_fw_idx, 0644, config_read_fw_idx_show, | 445 | static DEVICE_ATTR_RW(config_read_fw_idx); |
449 | config_read_fw_idx_store); | ||
450 | 446 | ||
451 | 447 | ||
452 | static ssize_t trigger_request_store(struct device *dev, | 448 | static 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 | } |
697 | static DEVICE_ATTR(config_test_driver, 0644, config_test_driver_show, | 697 | static DEVICE_ATTR_RW(config_test_driver); |
698 | config_test_driver_store); | ||
699 | 698 | ||
700 | static ssize_t config_test_fs_store(struct device *dev, | 699 | static 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 | } |
729 | static DEVICE_ATTR(config_test_fs, 0644, config_test_fs_show, | 728 | static DEVICE_ATTR_RW(config_test_fs); |
730 | config_test_fs_store); | ||
731 | 729 | ||
732 | static int trigger_config_run_type(struct kmod_test_device *test_dev, | 730 | static 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 | } |
1015 | static DEVICE_ATTR(config_num_threads, 0644, config_num_threads_show, | 1013 | static DEVICE_ATTR_RW(config_num_threads); |
1016 | config_num_threads_store); | ||
1017 | 1014 | ||
1018 | static ssize_t config_test_case_store(struct device *dev, | 1015 | static 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 | } |
1040 | static DEVICE_ATTR(config_test_case, 0644, config_test_case_show, | 1037 | static DEVICE_ATTR_RW(config_test_case); |
1041 | config_test_case_store); | ||
1042 | 1038 | ||
1043 | static ssize_t test_result_show(struct device *dev, | 1039 | static 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 | } |
1052 | static DEVICE_ATTR(test_result, 0644, test_result_show, test_result_store); | 1048 | static 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 | ||
857 | static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store); | 857 | static DEVICE_ATTR_RW(dma_op_mode); |
858 | 858 | ||
859 | static const struct attribute *additional_attrs[] = { | 859 | static 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 | ||
926 | static DEVICE_ATTR(st_taps, 0644, st_taps_show, st_taps_store); | 926 | static DEVICE_ATTR_RW(st_taps); |
927 | 927 | ||
928 | static const struct attribute *sidetone_attrs[] = { | 928 | static const struct attribute *sidetone_attrs[] = { |
929 | &dev_attr_st_taps.attr, | 929 | &dev_attr_st_taps.attr, |