aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2017-01-31 02:47:57 -0500
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-01-31 02:57:19 -0500
commit4585fbcb5331fc910b7e553ad3efd0dd7b320d14 (patch)
treebeb477ac919f1a2911bd43681f310354bd0045a8 /drivers/devfreq/devfreq.c
parent775fa8c3aa22df720f433e871f94cfb182f5913d (diff)
PM / devfreq: Modify the device name as devfreq(X) for sysfs
This patch modifies the device name as devfreq(X) for sysfs by using the 'devfreq' prefix word instead of separate device name. On user-space aspect, user would find the some devfreq drvier with 'devfreq(X)' pattern. So, this patch modify the device name as following: - /sys/class/devfreq/[non-standard device name] -> /sys/class/devfreq/devfreq(X) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 2e685164c549..4aa72b5ed660 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -519,6 +519,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
519{ 519{
520 struct devfreq *devfreq; 520 struct devfreq *devfreq;
521 struct devfreq_governor *governor; 521 struct devfreq_governor *governor;
522 static atomic_t devfreq_no = ATOMIC_INIT(-1);
522 int err = 0; 523 int err = 0;
523 524
524 if (!dev || !profile || !governor_name) { 525 if (!dev || !profile || !governor_name) {
@@ -560,7 +561,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
560 mutex_lock(&devfreq->lock); 561 mutex_lock(&devfreq->lock);
561 } 562 }
562 563
563 dev_set_name(&devfreq->dev, "%s", dev_name(dev)); 564 dev_set_name(&devfreq->dev, "devfreq%d",
565 atomic_inc_return(&devfreq_no));
564 err = device_register(&devfreq->dev); 566 err = device_register(&devfreq->dev);
565 if (err) { 567 if (err) {
566 mutex_unlock(&devfreq->lock); 568 mutex_unlock(&devfreq->lock);