mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] workqueue: Replace usage of init_name with dev_set_name()
@ 2016-02-17 20:04 Lars-Peter Clausen
  2016-02-17 21:15 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2016-02-17 20:04 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Lai Jiangshan, linux-kernel, Lars-Peter Clausen

The init_name property of the device struct is sort of a hack and should
only be used for statically allocated devices. Since the device is
dynamically allocated here it is safe to use the proper way to set a
devices name by calling dev_set_name().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7ff5dc7..3a1c99b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5222,8 +5222,8 @@ int workqueue_sysfs_register(struct workqueue_struct *wq)
 
 	wq_dev->wq = wq;
 	wq_dev->dev.bus = &wq_subsys;
-	wq_dev->dev.init_name = wq->name;
 	wq_dev->dev.release = wq_device_release;
+	dev_set_name(&wq_dev->dev, "%s", wq->name);
 
 	/*
 	 * unbound_attrs are created separately.  Suppress uevent until
-- 
2.1.4

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

end of thread, other threads:[~2016-02-17 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17 20:04 [PATCH] workqueue: Replace usage of init_name with dev_set_name() Lars-Peter Clausen
2016-02-17 21:15 ` Tejun Heo

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®