mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Baolin Wang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, baolin.wang@linaro.org,
	hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de
Subject: [tip:timers/core] clocksource: Use ATTRIBUTE_GROUPS
Date: Wed, 28 Feb 2018 05:10:43 -0800	[thread overview]
Message-ID: <tip-27263e8dc0f6fe27540a843611ec14a000591c41@git.kernel.org> (raw)
In-Reply-To: <d80dccb981dc2461781ebb8d71a32ccdc1b0e6f9.1516167691.git.baolin.wang@linaro.org>

Commit-ID:  27263e8dc0f6fe27540a843611ec14a000591c41
Gitweb:     https://git.kernel.org/tip/27263e8dc0f6fe27540a843611ec14a000591c41
Author:     Baolin Wang <baolin.wang@linaro.org>
AuthorDate: Wed, 17 Jan 2018 14:01:30 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 28 Feb 2018 14:05:07 +0100

clocksource: Use ATTRIBUTE_GROUPS

Use ATTRIBUTE_GROUPS instead of manually creating the individual device
files.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: arnd@arndb.de
Cc: sboyd@codeaurora.org
Cc: broonie@kernel.org
Cc: john.stultz@linaro.org
Link: https://lkml.kernel.org/r/d80dccb981dc2461781ebb8d71a32ccdc1b0e6f9.1516167691.git.baolin.wang@linaro.org
---
 kernel/time/clocksource.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 7ce53465782b..0e974cface0b 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -993,6 +993,14 @@ static ssize_t available_clocksource_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(available_clocksource);
 
+static struct attribute *clocksource_attrs[] = {
+	&dev_attr_current_clocksource.attr,
+	&dev_attr_unbind_clocksource.attr,
+	&dev_attr_available_clocksource.attr,
+	NULL
+};
+ATTRIBUTE_GROUPS(clocksource);
+
 static struct bus_type clocksource_subsys = {
 	.name = "clocksource",
 	.dev_name = "clocksource",
@@ -1001,6 +1009,7 @@ static struct bus_type clocksource_subsys = {
 static struct device device_clocksource = {
 	.id	= 0,
 	.bus	= &clocksource_subsys,
+	.groups	= clocksource_groups,
 };
 
 static int __init init_clocksource_sysfs(void)
@@ -1009,17 +1018,7 @@ static int __init init_clocksource_sysfs(void)
 
 	if (!error)
 		error = device_register(&device_clocksource);
-	if (!error)
-		error = device_create_file(
-				&device_clocksource,
-				&dev_attr_current_clocksource);
-	if (!error)
-		error = device_create_file(&device_clocksource,
-					   &dev_attr_unbind_clocksource);
-	if (!error)
-		error = device_create_file(
-				&device_clocksource,
-				&dev_attr_available_clocksource);
+
 	return error;
 }
 

  reply	other threads:[~2018-02-28 13:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  6:01 [PATCH 1/3] clocksource: Skip to check the override clocksource if override name is empty Baolin Wang
2018-01-17  6:01 ` [PATCH 2/3] clocksource: Use DEVICE_ATTR_RW/RO/WO to define device attributes Baolin Wang
2018-02-28 13:10   ` [tip:timers/core] " tip-bot for Baolin Wang
2018-01-17  6:01 ` [PATCH 3/3] clocksource: Use ATTRIBUTE_GROUPS macro Baolin Wang
2018-02-28 13:10   ` tip-bot for Baolin Wang [this message]
2018-02-28 13:09 ` [tip:timers/core] clocksource: Don't walk the clocksource list for empty override tip-bot for Baolin Wang

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=tip-27263e8dc0f6fe27540a843611ec14a000591c41@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=baolin.wang@linaro.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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®