diff options
author | YueHaibing <yuehaibing@huawei.com> | 2021-05-24 10:11:58 +0800 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2021-06-17 17:08:46 +0900 |
commit | 1ad4f329fccb5d9eb7b0a38d7fdf0f4688c6b341 (patch) | |
tree | 651e5418f1c227db1b9cdf4cb49d5401e03591e1 /drivers/devfreq | |
parent | a15fc9aa5b384e305ea25f42f744bb301fe39da0 (diff) | |
download | lwn-1ad4f329fccb5d9eb7b0a38d7fdf0f4688c6b341.tar.gz lwn-1ad4f329fccb5d9eb7b0a38d7fdf0f4688c6b341.zip |
PM / devfreq: userspace: Use DEVICE_ATTR_RW macro
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>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/governor_userspace.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c index 0fd6c4851071..ab9db7adb3ad 100644 --- a/drivers/devfreq/governor_userspace.c +++ b/drivers/devfreq/governor_userspace.c @@ -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; @@ -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; @@ -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, |