public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH wq/for-next 1/2] workqueue: let subsystem core create the cpumask attribute
@ 2021-06-07  9:44 Julian Wiedmann
  2021-06-07  9:44 ` [PATCH wq/for-next 2/2] workqueue: let device core create the WQ_UNBOUND attributes Julian Wiedmann
  0 siblings, 1 reply; 5+ messages in thread
From: Julian Wiedmann @ 2021-06-07  9:44 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Greg Kroah-Hartman, Julian Wiedmann, Lai Jiangshan, linux-kernel

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-07 10:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-07  9:44 [PATCH wq/for-next 1/2] workqueue: let subsystem core create the cpumask attribute Julian Wiedmann
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox