All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, rjw@rjwysocki.net
Cc: cw00.choi@samsung.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs
Date: Mon, 23 Jan 2017 12:31:39 +0900	[thread overview]
Message-ID: <1485142299-9986-5-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1485142299-9986-1-git-send-email-cw00.choi@samsung.com>

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>
---
 drivers/devfreq/devfreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 8e5938c9c7d6..493f9ce250ff 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -527,6 +527,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) {
@@ -568,7 +569,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);
-- 
1.9.1

      parent reply	other threads:[~2017-01-23  3:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170123033151epcas5p3349612f1f97c31d85d90604cbca8a19d@epcas5p3.samsung.com>
2017-01-23  3:31 ` [PATCH v4 0/4] PM / devfreq: Update the devfreq and devfreq-event device Chanwoo Choi
     [not found]   ` <CGME20170123033151epcas5p3a484d70bbdef282b92eb8d97d912e75c@epcas5p3.samsung.com>
2017-01-23  3:31     ` [PATCH v4 1/4] PM / devfreq: Fix the wrong description for userspace governor Chanwoo Choi
2017-01-24  3:42     ` MyungJoo Ham
2017-01-30 10:44       ` Rafael J. Wysocki
2017-01-31  4:51       ` MyungJoo Ham
     [not found]   ` <CGME20170123033151epcas5p341aa786474af221e390eed87ea48381e@epcas5p3.samsung.com>
2017-01-23  3:31     ` [PATCH v4 2/4] PM / devfreq: exynos-ppmu: Show the registred device for ppmu device Chanwoo Choi
2017-01-24  3:42     ` MyungJoo Ham
2017-01-24  8:15       ` Chanwoo Choi
     [not found]   ` <CGME20170123033152epcas5p34efc72ecd1afb21efca58421ab41cbc6@epcas5p3.samsung.com>
2017-01-23  3:31     ` [PATCH v4 3/4] PM / devfreq: Simplify the sysfs name of devfreq-event device Chanwoo Choi
     [not found]   ` <CGME20170123033152epcas5p3c2d5ced0fcce359e8fd2d0576462c029@epcas5p3.samsung.com>
2017-01-23  3:31     ` Chanwoo Choi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485142299-9986-5-git-send-email-cw00.choi@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.