Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -404,8 +404,7 @@ static ssize_t dispatching_store(struct device *dev,
	put_online_cpus();
	return rc ? rc : count;
}
static DEVICE_ATTR(dispatching, 0644, dispatching_show,
			 dispatching_store);
static DEVICE_ATTR_RW(dispatching);

static ssize_t cpu_polarization_show(struct device *dev,
				     struct device_attribute *attr, char *buf)
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ static ssize_t hv_stats_store(struct device *dev,
	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)
{
+3 −3
Original line number Diff line number Diff line
@@ -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_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(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store);
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_boost_freq_mhz);
static DEVICE_ATTR_RW(gt_max_freq_mhz);
static DEVICE_ATTR_RW(gt_min_freq_mhz);

static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL);

+6 −12
Original line number Diff line number Diff line
@@ -679,18 +679,12 @@ static int bat_writeable_property(struct power_supply *psy,
/* ============== */
/* Driver Globals */
/* ============== */
static DEVICE_ATTR(wake_up_pme,
		0644, wake_up_pme_show,		wake_up_pme_store);
static DEVICE_ATTR(wake_up_modem,
		0644, wake_up_modem_show,	wake_up_modem_store);
static DEVICE_ATTR(wake_up_lan,
		0644, wake_up_lan_show,	wake_up_lan_store);
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_RW(wake_up_pme);
static DEVICE_ATTR_RW(wake_up_modem);
static DEVICE_ATTR_RW(wake_up_lan);
static DEVICE_ATTR_RW(wake_up_wlan);
static DEVICE_ATTR_RW(wake_up_key);
static DEVICE_ATTR_RW(wake_up_mouse);

static DEVICE_ATTR(fan1_input,  S_IRUGO, fan_show,          NULL);
static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu,          NULL);
+1 −1
Original line number Diff line number Diff line
@@ -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(cutype, 0444, cutype_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(logging, 0200, NULL, initiate_logging);
static DEVICE_ATTR(vpm, 0444, vpm_show, NULL);
Loading