Skip to content

Commit

Permalink
PM / devfreq: userspace: Use DEVICE_ATTR_RW macro
Browse files Browse the repository at this point in the history
Use DEVICE_ATTR_RW helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
  • Loading branch information
YueHaibing authored and Chanwoo Choi committed Jun 17, 2021
1 parent a15fc9a commit 1ad4f32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/devfreq/governor_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq)
return 0;
}

static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t set_freq_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct devfreq *devfreq = to_devfreq(dev);
struct userspace_data *data;
Expand All @@ -52,8 +52,8 @@ static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
return err;
}

static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
char *buf)
static ssize_t set_freq_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct devfreq *devfreq = to_devfreq(dev);
struct userspace_data *data;
Expand All @@ -70,7 +70,7 @@ static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
return err;
}

static DEVICE_ATTR(set_freq, 0644, show_freq, store_freq);
static DEVICE_ATTR_RW(set_freq);
static struct attribute *dev_entries[] = {
&dev_attr_set_freq.attr,
NULL,
Expand Down

0 comments on commit 1ad4f32

Please sign in to comment.