Skip to contentSkip to conversation

workqueue: Replace usage of init_name with dev_set_name()

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Feb 17, 2016 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: Replace usage of init_name with dev_set_name()

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().

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index 7ff5dc7..3a1c99b 100644
@@ -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
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 6 lines · 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().

Applied to wq/for-4.6.

Thanks.

Signature · 1 line
tejun