Commit b6b996b6 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

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: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 353c6dda
...@@ -404,8 +404,7 @@ static ssize_t dispatching_store(struct device *dev, ...@@ -404,8 +404,7 @@ static ssize_t dispatching_store(struct device *dev,
put_online_cpus(); put_online_cpus();
return rc ? rc : count; return rc ? rc : count;
} }
static DEVICE_ATTR(dispatching, 0644, dispatching_show, static DEVICE_ATTR_RW(dispatching);
dispatching_store);
static ssize_t cpu_polarization_show(struct device *dev, static ssize_t cpu_polarization_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
......
...@@ -184,7 +184,7 @@ static ssize_t hv_stats_store(struct device *dev, ...@@ -184,7 +184,7 @@ static ssize_t hv_stats_store(struct device *dev,
return n < 0 ? n : count; return n < 0 ? n : count;
} }
static DEVICE_ATTR(hv_stats, 0644, hv_stats_show, hv_stats_store); static DEVICE_ATTR_RW(hv_stats);
static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif) static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif)
{ {
......
...@@ -436,9 +436,9 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev, ...@@ -436,9 +436,9 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL); static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL);
static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL); static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL);
static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store); static DEVICE_ATTR_RW(gt_boost_freq_mhz);
static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store); static DEVICE_ATTR_RW(gt_max_freq_mhz);
static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store); static DEVICE_ATTR_RW(gt_min_freq_mhz);
static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL); static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL);
......
...@@ -679,18 +679,12 @@ static int bat_writeable_property(struct power_supply *psy, ...@@ -679,18 +679,12 @@ static int bat_writeable_property(struct power_supply *psy,
/* ============== */ /* ============== */
/* Driver Globals */ /* Driver Globals */
/* ============== */ /* ============== */
static DEVICE_ATTR(wake_up_pme, static DEVICE_ATTR_RW(wake_up_pme);
0644, wake_up_pme_show, wake_up_pme_store); static DEVICE_ATTR_RW(wake_up_modem);
static DEVICE_ATTR(wake_up_modem, static DEVICE_ATTR_RW(wake_up_lan);
0644, wake_up_modem_show, wake_up_modem_store); static DEVICE_ATTR_RW(wake_up_wlan);
static DEVICE_ATTR(wake_up_lan, static DEVICE_ATTR_RW(wake_up_key);
0644, wake_up_lan_show, wake_up_lan_store); static DEVICE_ATTR_RW(wake_up_mouse);
static DEVICE_ATTR(wake_up_wlan,
0644, wake_up_wlan_show, wake_up_wlan_store);
static DEVICE_ATTR(wake_up_key,
0644, wake_up_key_show, wake_up_key_store);
static DEVICE_ATTR(wake_up_mouse,
0644, wake_up_mouse_show, wake_up_mouse_store);
static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL); static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL);
static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL); static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL);
......
...@@ -600,7 +600,7 @@ static ssize_t vpm_show(struct device *dev, struct device_attribute *attr, ...@@ -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(devtype, 0444, devtype_show, NULL);
static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); static DEVICE_ATTR(cutype, 0444, cutype_show, NULL);
static DEVICE_ATTR(modalias, 0444, modalias_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(availability, 0444, available_show, NULL);
static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); static DEVICE_ATTR(logging, 0200, NULL, initiate_logging);
static DEVICE_ATTR(vpm, 0444, vpm_show, NULL); static DEVICE_ATTR(vpm, 0444, vpm_show, NULL);
......
...@@ -2485,8 +2485,7 @@ lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr, ...@@ -2485,8 +2485,7 @@ lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr,
"reinit adapter - %d\n", stat2); "reinit adapter - %d\n", stat2);
return (stat1 || stat2) ? -EIO : count; return (stat1 || stat2) ? -EIO : count;
} }
static DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_soft_wwpn);
lpfc_soft_wwpn_show, lpfc_soft_wwpn_store);
/** /**
* lpfc_soft_wwnn_show - Return the cfg soft ww node name for the adapter * 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,8 +2548,7 @@ lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr,
return count; return count;
} }
static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_soft_wwnn);
lpfc_soft_wwnn_show, lpfc_soft_wwnn_store);
/** /**
* lpfc_oas_tgt_show - Return wwpn of target whose luns maybe enabled for * 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,8 +3066,7 @@ MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:"
" 1 - poll with interrupts enabled" " 1 - poll with interrupts enabled"
" 3 - poll and disable FCP ring interrupts"); " 3 - poll and disable FCP ring interrupts");
static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_poll);
lpfc_poll_show, lpfc_poll_store);
int lpfc_no_hba_reset_cnt; int lpfc_no_hba_reset_cnt;
unsigned long lpfc_no_hba_reset[MAX_HBAS_NO_RESET] = { 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,8 +3299,7 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
lpfc_vport_param_store(nodev_tmo) lpfc_vport_param_store(nodev_tmo)
static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_nodev_tmo);
lpfc_nodev_tmo_show, lpfc_nodev_tmo_store);
/* /*
# lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that # 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,8 +3348,7 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
} }
lpfc_vport_param_store(devloss_tmo) lpfc_vport_param_store(devloss_tmo)
static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_devloss_tmo);
lpfc_devloss_tmo_show, lpfc_devloss_tmo_store);
/* /*
* lpfc_suppress_rsp: Enable suppress rsp feature is firmware supports it * 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,8 +3540,7 @@ lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
return 0; return 0;
} }
lpfc_vport_param_store(restrict_login); lpfc_vport_param_store(restrict_login);
static DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_restrict_login);
lpfc_restrict_login_show, lpfc_restrict_login_store);
/* /*
# Some disk devices have a "select ID" or "select Target" capability. # 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,8 +3654,7 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
} }
lpfc_param_show(topology) lpfc_param_show(topology)
static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_topology);
lpfc_topology_show, lpfc_topology_store);
/** /**
* lpfc_static_vport_show: Read callback function for * 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,8 +3912,7 @@ lpfc_stat_data_ctrl_show(struct device *dev, struct device_attribute *attr,
/* /*
* Sysfs attribute to control the statistical data collection. * Sysfs attribute to control the statistical data collection.
*/ */
static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_stat_data_ctrl);
lpfc_stat_data_ctrl_show, lpfc_stat_data_ctrl_store);
/* /*
* lpfc_drvr_stat_data: sysfs attr to get driver statistical data. * 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,8 +4151,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val)
return -EINVAL; return -EINVAL;
} }
static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_link_speed);
lpfc_link_speed_show, lpfc_link_speed_store);
/* /*
# lpfc_aer_support: Support PCIe device Advanced Error Reporting (AER) # 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,8 +4244,7 @@ lpfc_aer_support_store(struct device *dev, struct device_attribute *attr,
return rc; return rc;
} }
static DEVICE_ATTR(lpfc_aer_support, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_aer_support);
lpfc_aer_support_show, lpfc_aer_support_store);
/** /**
* lpfc_aer_cleanup_state - Clean up aer state to the aer enabled device * 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,8 +4391,7 @@ LPFC_ATTR(sriov_nr_virtfn, LPFC_DEF_VFN_PER_PFN, 0, LPFC_MAX_VFN_PER_PFN,
"Enable PCIe device SR-IOV virtual fn"); "Enable PCIe device SR-IOV virtual fn");
lpfc_param_show(sriov_nr_virtfn) lpfc_param_show(sriov_nr_virtfn)
static DEVICE_ATTR(lpfc_sriov_nr_virtfn, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_sriov_nr_virtfn);
lpfc_sriov_nr_virtfn_show, lpfc_sriov_nr_virtfn_store);
/** /**
* lpfc_request_firmware_store - Request for Linux generic firmware upgrade * 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,8 +4565,7 @@ lpfc_fcp_imax_init(struct lpfc_hba *phba, int val)
return 0; return 0;
} }
static DEVICE_ATTR(lpfc_fcp_imax, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_fcp_imax);
lpfc_fcp_imax_show, lpfc_fcp_imax_store);
/* /*
* lpfc_auto_imax: Controls Auto-interrupt coalescing values support. * 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,8 +4725,7 @@ lpfc_fcp_cpu_map_init(struct lpfc_hba *phba, int val)
return 0; return 0;
} }
static DEVICE_ATTR(lpfc_fcp_cpu_map, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_fcp_cpu_map);
lpfc_fcp_cpu_map_show, lpfc_fcp_cpu_map_store);
/* /*
# lpfc_fcp_class: Determines FC class to use for the FCP protocol. # 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,9 +4811,7 @@ lpfc_max_scsicmpl_time_set(struct lpfc_vport *vport, int val)
return 0; return 0;
} }
lpfc_vport_param_store(max_scsicmpl_time); lpfc_vport_param_store(max_scsicmpl_time);
static DEVICE_ATTR(lpfc_max_scsicmpl_time, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(lpfc_max_scsicmpl_time);
lpfc_max_scsicmpl_time_show,
lpfc_max_scsicmpl_time_store);
/* /*
# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value # lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value
......
...@@ -398,14 +398,13 @@ create_s32_tzp_attr(offset); ...@@ -398,14 +398,13 @@ create_s32_tzp_attr(offset);
*/ */
static DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(type, 0444, type_show, NULL);
static DEVICE_ATTR(temp, 0444, temp_show, NULL); static DEVICE_ATTR(temp, 0444, temp_show, NULL);
static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store); static DEVICE_ATTR_RW(policy);
static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL); static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL);
static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, static DEVICE_ATTR_RW(sustainable_power);
sustainable_power_store);
/* These thermal zone device attributes are created based on conditions */ /* These thermal zone device attributes are created based on conditions */
static DEVICE_ATTR(mode, 0644, mode_show, mode_store); static DEVICE_ATTR_RW(mode);
static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); static DEVICE_ATTR_RW(passive);
/* These attributes are unconditionally added to a thermal zone */ /* These attributes are unconditionally added to a thermal zone */
static struct attribute *thermal_zone_dev_attrs[] = { static struct attribute *thermal_zone_dev_attrs[] = {
......
...@@ -1144,7 +1144,7 @@ static ssize_t rx_fifo_timeout_store(struct device *dev, ...@@ -1144,7 +1144,7 @@ static ssize_t rx_fifo_timeout_store(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(rx_fifo_timeout, 0644, rx_fifo_timeout_show, rx_fifo_timeout_store); static DEVICE_ATTR_RW(rx_fifo_timeout);
#ifdef CONFIG_SERIAL_SH_SCI_DMA #ifdef CONFIG_SERIAL_SH_SCI_DMA
......
...@@ -310,7 +310,7 @@ static ssize_t otg_mode_store(struct device *device, ...@@ -310,7 +310,7 @@ static ssize_t otg_mode_store(struct device *device,
return r; return r;
} }
static DEVICE_ATTR(otg_mode, 0644, otg_mode_show, otg_mode_store); static DEVICE_ATTR_RW(otg_mode);
static struct attribute *tahvo_attributes[] = { static struct attribute *tahvo_attributes[] = {
&dev_attr_vbus.attr, &dev_attr_vbus.attr,
......
...@@ -708,8 +708,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, ...@@ -708,8 +708,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
return sprintf(buf, "%d\n", temp); return sprintf(buf, "%d\n", temp);
} }
static DEVICE_ATTR(update_mode, 0644, update_mode_show, update_mode_store); static DEVICE_ATTR_RW(update_mode);
static DEVICE_ATTR(flash, 0644, flash_show, flash_store); static DEVICE_ATTR_RW(flash);
static DEVICE_ATTR(temp, 0644, temp_show, NULL); static DEVICE_ATTR(temp, 0644, temp_show, NULL);
static struct attribute *auok190x_attributes[] = { static struct attribute *auok190x_attributes[] = {
......
...@@ -110,7 +110,7 @@ static ssize_t flip_store(struct device *dev, struct device_attribute *attr, con ...@@ -110,7 +110,7 @@ static ssize_t flip_store(struct device *dev, struct device_attribute *attr, con
return count; return count;
} }
static DEVICE_ATTR(flip, 0644, flip_show, flip_store); static DEVICE_ATTR_RW(flip);
static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{ {
...@@ -166,7 +166,7 @@ static ssize_t fastpllclk_store(struct device *dev, struct device_attribute *att ...@@ -166,7 +166,7 @@ static ssize_t fastpllclk_store(struct device *dev, struct device_attribute *att
return count; return count;
} }
static DEVICE_ATTR(fastpllclk, 0644, fastpllclk_show, fastpllclk_store); static DEVICE_ATTR_RW(fastpllclk);
/* /*
* Some touchscreens need hsync information from the video driver to * Some touchscreens need hsync information from the video driver to
......
...@@ -359,7 +359,7 @@ static ssize_t config_name_show(struct device *dev, ...@@ -359,7 +359,7 @@ static ssize_t config_name_show(struct device *dev,
{ {
return config_test_show_str(buf, test_fw_config->name); return config_test_show_str(buf, test_fw_config->name);
} }
static DEVICE_ATTR(config_name, 0644, config_name_show, config_name_store); static DEVICE_ATTR_RW(config_name);
static ssize_t config_num_requests_store(struct device *dev, static ssize_t config_num_requests_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -388,8 +388,7 @@ static ssize_t config_num_requests_show(struct device *dev, ...@@ -388,8 +388,7 @@ static ssize_t config_num_requests_show(struct device *dev,
{ {
return test_dev_config_show_u8(buf, test_fw_config->num_requests); return test_dev_config_show_u8(buf, test_fw_config->num_requests);
} }
static DEVICE_ATTR(config_num_requests, 0644, config_num_requests_show, static DEVICE_ATTR_RW(config_num_requests);
config_num_requests_store);
static ssize_t config_sync_direct_store(struct device *dev, static ssize_t config_sync_direct_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -411,8 +410,7 @@ static ssize_t config_sync_direct_show(struct device *dev, ...@@ -411,8 +410,7 @@ static ssize_t config_sync_direct_show(struct device *dev,
{ {
return test_dev_config_show_bool(buf, test_fw_config->sync_direct); return test_dev_config_show_bool(buf, test_fw_config->sync_direct);
} }
static DEVICE_ATTR(config_sync_direct, 0644, config_sync_direct_show, static DEVICE_ATTR_RW(config_sync_direct);
config_sync_direct_store);
static ssize_t config_send_uevent_store(struct device *dev, static ssize_t config_send_uevent_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -428,8 +426,7 @@ static ssize_t config_send_uevent_show(struct device *dev, ...@@ -428,8 +426,7 @@ static ssize_t config_send_uevent_show(struct device *dev,
{ {
return test_dev_config_show_bool(buf, test_fw_config->send_uevent); return test_dev_config_show_bool(buf, test_fw_config->send_uevent);
} }
static DEVICE_ATTR(config_send_uevent, 0644, config_send_uevent_show, static DEVICE_ATTR_RW(config_send_uevent);
config_send_uevent_store);
static ssize_t config_read_fw_idx_store(struct device *dev, static ssize_t config_read_fw_idx_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -445,8 +442,7 @@ static ssize_t config_read_fw_idx_show(struct device *dev, ...@@ -445,8 +442,7 @@ static ssize_t config_read_fw_idx_show(struct device *dev,
{ {
return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx); return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx);
} }
static DEVICE_ATTR(config_read_fw_idx, 0644, config_read_fw_idx_show, static DEVICE_ATTR_RW(config_read_fw_idx);
config_read_fw_idx_store);
static ssize_t trigger_request_store(struct device *dev, static ssize_t trigger_request_store(struct device *dev,
......
...@@ -694,8 +694,7 @@ static ssize_t config_test_driver_show(struct device *dev, ...@@ -694,8 +694,7 @@ static ssize_t config_test_driver_show(struct device *dev,
return config_test_show_str(&test_dev->config_mutex, buf, return config_test_show_str(&test_dev->config_mutex, buf,
config->test_driver); config->test_driver);
} }
static DEVICE_ATTR(config_test_driver, 0644, config_test_driver_show, static DEVICE_ATTR_RW(config_test_driver);
config_test_driver_store);
static ssize_t config_test_fs_store(struct device *dev, static ssize_t config_test_fs_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -726,8 +725,7 @@ static ssize_t config_test_fs_show(struct device *dev, ...@@ -726,8 +725,7 @@ static ssize_t config_test_fs_show(struct device *dev,
return config_test_show_str(&test_dev->config_mutex, buf, return config_test_show_str(&test_dev->config_mutex, buf,
config->test_fs); config->test_fs);
} }
static DEVICE_ATTR(config_test_fs, 0644, config_test_fs_show, static DEVICE_ATTR_RW(config_test_fs);
config_test_fs_store);
static int trigger_config_run_type(struct kmod_test_device *test_dev, static int trigger_config_run_type(struct kmod_test_device *test_dev,
enum kmod_test_case test_case, enum kmod_test_case test_case,
...@@ -1012,8 +1010,7 @@ static ssize_t config_num_threads_show(struct device *dev, ...@@ -1012,8 +1010,7 @@ static ssize_t config_num_threads_show(struct device *dev,
return test_dev_config_show_int(test_dev, buf, config->num_threads); return test_dev_config_show_int(test_dev, buf, config->num_threads);
} }
static DEVICE_ATTR(config_num_threads, 0644, config_num_threads_show, static DEVICE_ATTR_RW(config_num_threads);
config_num_threads_store);
static ssize_t config_test_case_store(struct device *dev, static ssize_t config_test_case_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -1037,8 +1034,7 @@ static ssize_t config_test_case_show(struct device *dev, ...@@ -1037,8 +1034,7 @@ static ssize_t config_test_case_show(struct device *dev,
return test_dev_config_show_uint(test_dev, buf, config->test_case); return test_dev_config_show_uint(test_dev, buf, config->test_case);
} }
static DEVICE_ATTR(config_test_case, 0644, config_test_case_show, static DEVICE_ATTR_RW(config_test_case);
config_test_case_store);
static ssize_t test_result_show(struct device *dev, static ssize_t test_result_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -1049,7 +1045,7 @@ static ssize_t test_result_show(struct device *dev, ...@@ -1049,7 +1045,7 @@ static ssize_t test_result_show(struct device *dev,
return test_dev_config_show_int(test_dev, buf, config->test_result); return test_dev_config_show_int(test_dev, buf, config->test_result);
} }
static DEVICE_ATTR(test_result, 0644, test_result_show, test_result_store); static DEVICE_ATTR_RW(test_result);
#define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr #define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr
......
...@@ -854,7 +854,7 @@ static ssize_t dma_op_mode_store(struct device *dev, ...@@ -854,7 +854,7 @@ static ssize_t dma_op_mode_store(struct device *dev,
return size; return size;
} }
static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store); static DEVICE_ATTR_RW(dma_op_mode);
static const struct attribute *additional_attrs[] = { static const struct attribute *additional_attrs[] = {
&dev_attr_max_tx_thres.attr, &dev_attr_max_tx_thres.attr,
...@@ -923,7 +923,7 @@ static ssize_t st_taps_store(struct device *dev, ...@@ -923,7 +923,7 @@ static ssize_t st_taps_store(struct device *dev,
return size; return size;
} }
static DEVICE_ATTR(st_taps, 0644, st_taps_show, st_taps_store); static DEVICE_ATTR_RW(st_taps);
static const struct attribute *sidetone_attrs[] = { static const struct attribute *sidetone_attrs[] = {
&dev_attr_st_taps.attr, &dev_attr_st_taps.attr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment