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 3/4] PM / devfreq: Simplify the sysfs name of devfreq-event device
Date: Mon, 23 Jan 2017 12:31:38 +0900 [thread overview]
Message-ID: <1485142299-9986-4-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1485142299-9986-1-git-send-email-cw00.choi@samsung.com>
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).
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/devfreq/devfreq-event.c | 4 ++--
1 file 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,
struct devfreq_event_desc *desc)
{
struct devfreq_event_dev *edev;
- static atomic_t event_no = ATOMIC_INIT(0);
+ static atomic_t event_no = ATOMIC_INIT(-1);
int ret;
if (!dev || !desc)
@@ -329,7 +329,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
edev->dev.class = devfreq_event_class;
edev->dev.release = devfreq_event_release_edev;
- dev_set_name(&edev->dev, "event.%d", atomic_inc_return(&event_no) - 1);
+ dev_set_name(&edev->dev, "event%d", atomic_inc_return(&event_no));
ret = device_register(&edev->dev);
if (ret < 0) {
put_device(&edev->dev);
--
1.9.1
next prev 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 " 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] ` <CGME20170123033152epcas5p34efc72ecd1afb21efca58421ab41cbc6@epcas5p3.samsung.com>
2017-01-23 3:31 ` Chanwoo Choi [this message]
[not found] ` <CGME20170123033152epcas5p3c2d5ced0fcce359e8fd2d0576462c029@epcas5p3.samsung.com>
2017-01-23 3:31 ` [PATCH v4 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs Chanwoo Choi
[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
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-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®