Skip to content

Commit 1ad4f32

Browse files
YueHaibingchanwoochoi
authored andcommitted
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 <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent a15fc9a commit 1ad4f32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/devfreq/governor_userspace.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq)
3131
return 0;
3232
}
3333

34-
static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
35-
const char *buf, size_t count)
34+
static ssize_t set_freq_store(struct device *dev, struct device_attribute *attr,
35+
const char *buf, size_t count)
3636
{
3737
struct devfreq *devfreq = to_devfreq(dev);
3838
struct userspace_data *data;
@@ -52,8 +52,8 @@ static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
5252
return err;
5353
}
5454

55-
static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
56-
char *buf)
55+
static ssize_t set_freq_show(struct device *dev,
56+
struct device_attribute *attr, char *buf)
5757
{
5858
struct devfreq *devfreq = to_devfreq(dev);
5959
struct userspace_data *data;
@@ -70,7 +70,7 @@ static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
7070
return err;
7171
}
7272

73-
static DEVICE_ATTR(set_freq, 0644, show_freq, store_freq);
73+
static DEVICE_ATTR_RW(set_freq);
7474
static struct attribute *dev_entries[] = {
7575
&dev_attr_set_freq.attr,
7676
NULL,

0 commit comments

Comments
 (0)