Skip to content

Commit

Permalink
PM / devfreq: Modify the device name as devfreq(X) for sysfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chanwoo Choi authored and MyungJoo Ham committed Jan 31, 2017
1 parent 775fa8c commit 4585fbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
{
struct devfreq *devfreq;
struct devfreq_governor *governor;
static atomic_t devfreq_no = ATOMIC_INIT(-1);
int err = 0;

if (!dev || !profile || !governor_name) {
Expand Down Expand Up @@ -560,7 +561,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
mutex_lock(&devfreq->lock);
}

dev_set_name(&devfreq->dev, "%s", dev_name(dev));
dev_set_name(&devfreq->dev, "devfreq%d",
atomic_inc_return(&devfreq_no));
err = device_register(&devfreq->dev);
if (err) {
mutex_unlock(&devfreq->lock);
Expand Down

0 comments on commit 4585fbc

Please sign in to comment.