diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2017-01-31 02:47:56 -0500 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-01-31 02:57:05 -0500 |
commit | 775fa8c3aa22df720f433e871f94cfb182f5913d (patch) | |
tree | e685ff0bf8cc6a2004e559620a0e3312b3bb3813 /drivers/devfreq | |
parent | 29b6968b05b6a4a858ba3ce767be1025ab59f2ca (diff) |
PM / devfreq: Simplify the sysfs name of devfreq-event device
This patch just removes '.' character from the sysfs name of devfreq-event
device as following. Usually, the subsystem uses the similiar naming style
such as {framework name}{Number}.
- old : /sys/class/devfreq-event/event.(X)
- new : /sys/class/devfreq-event/event(X)
And this patch initializes the value of 'event_no' with -1
in order to remove the unneeded operation (-1) when calling
the atomic_inc_return(&event_no).
Lastly, this patch adds the ABI document for devfreq-event class.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/devfreq-event.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 9aea2c7ecbe6..8648b32ebc89 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c | |||
@@ -306,7 +306,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, | |||
306 | struct devfreq_event_desc *desc) | 306 | struct devfreq_event_desc *desc) |
307 | { | 307 | { |
308 | struct devfreq_event_dev *edev; | 308 | struct devfreq_event_dev *edev; |
309 | static atomic_t event_no = ATOMIC_INIT(0); | 309 | static atomic_t event_no = ATOMIC_INIT(-1); |
310 | int ret; | 310 | int ret; |
311 | 311 | ||
312 | if (!dev || !desc) | 312 | if (!dev || !desc) |
@@ -329,7 +329,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, | |||
329 | edev->dev.class = devfreq_event_class; | 329 | edev->dev.class = devfreq_event_class; |
330 | edev->dev.release = devfreq_event_release_edev; | 330 | edev->dev.release = devfreq_event_release_edev; |
331 | 331 | ||
332 | dev_set_name(&edev->dev, "event.%d", atomic_inc_return(&event_no) - 1); | 332 | dev_set_name(&edev->dev, "event%d", atomic_inc_return(&event_no)); |
333 | ret = device_register(&edev->dev); | 333 | ret = device_register(&edev->dev); |
334 | if (ret < 0) { | 334 | if (ret < 0) { |
335 | put_device(&edev->dev); | 335 | put_device(&edev->dev); |