From: Julian Wiedmann <jwi@linux.ibm.com>
To: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Julian Wiedmann <jwi@linux.ibm.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH wq/for-next 1/2] workqueue: let subsystem core create the cpumask attribute
Date: Mon, 7 Jun 2021 11:44:19 +0200 [thread overview]
Message-ID: <20210607094420.2054403-1-jwi@linux.ibm.com> (raw)
Wrap the cpumask attribute in an ATTRIBUTE_GROUPS() macro, so that
subsys_virtual_register() can add it to the dev_root device for us.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
kernel/workqueue.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 104e3ef04e33..817dc2d7438a 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5625,15 +5625,15 @@ static struct device_attribute wq_sysfs_cpumask_attr =
__ATTR(cpumask, 0644, wq_unbound_cpumask_show,
wq_unbound_cpumask_store);
+static struct attribute *wq_sysfs_dev_root_attrs[] = {
+ &wq_sysfs_cpumask_attr.attr,
+ NULL,
+};
+ATTRIBUTE_GROUPS(wq_sysfs_dev_root);
+
static int __init wq_sysfs_init(void)
{
- int err;
-
- err = subsys_virtual_register(&wq_subsys, NULL);
- if (err)
- return err;
-
- return device_create_file(wq_subsys.dev_root, &wq_sysfs_cpumask_attr);
+ return subsys_virtual_register(&wq_subsys, wq_sysfs_dev_root_groups);
}
core_initcall(wq_sysfs_init);
--
2.25.1
next reply other threads:[~2021-06-07 9:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 9:44 Julian Wiedmann [this message]
2021-06-07 9:44 ` [PATCH wq/for-next 2/2] workqueue: let device core create the WQ_UNBOUND attributes Julian Wiedmann
2021-06-07 10:27 ` Greg Kroah-Hartman
2021-06-07 10:34 ` Julian Wiedmann
2021-06-07 10:41 ` Greg Kroah-Hartman
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=20210607094420.2054403-1-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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