Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1336734 > unrolled thread
| Started by | Lars-Peter Clausen <lars@metafoo.de> |
|---|---|
| First post | 2016-02-17 21:30 +0100 |
| Last post | 2016-02-17 22:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] workqueue: Replace usage of init_name with dev_set_name() Lars-Peter Clausen <lars@metafoo.de> - 2016-02-17 21:30 +0100
Re: [PATCH] workqueue: Replace usage of init_name with dev_set_name() Tejun Heo <tj@kernel.org> - 2016-02-17 22:20 +0100
| From | Lars-Peter Clausen <lars@metafoo.de> |
|---|---|
| Date | 2016-02-17 21:30 +0100 |
| Subject | [PATCH] workqueue: Replace usage of init_name with dev_set_name() |
| Message-ID | <r3gTw-36M-13@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-17 22:20 +0100 |
| Message-ID | <r3hFV-3GO-29@gated-at.bofh.it> |
| In reply to | #1336734 |
On Wed, Feb 17, 2016 at 09:04:41PM +0100, Lars-Peter Clausen wrote: > 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> Applied to wq/for-4.6. Thanks. -- tejun
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web