]> git.baikalelectronics.ru Git - kernel.git/commit
usb: hub: keep hub->dev reference all the time when struct usb_hub lives
authorPetr Mladek <pmladek@suse.cz>
Fri, 19 Sep 2014 15:32:19 +0000 (17:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 05:31:11 +0000 (22:31 -0700)
commit3e67068509cc11b3dfaa7bb3b658c6acd6b6e394
tree3ba33ad527e7d931635594a7b6727e4888415bc2
parent386789ea7b5554d07b09f1932e90c99eb8be3ebb
usb: hub: keep hub->dev reference all the time when struct usb_hub lives

This is just a small optimization of the fix from the commit 010254e43305973509
("usb: hub: take hub->hdev reference when processing from eventlist).

We do not need to take the reference for each event. Instead we could get it
when struct usb_hub is allocated and put it when it is released. By other words,
we could handle it the same way as the reference for hub->intfdev.

The motivation is that it will make the life easier when switching from khubd
kthread to a workqueue.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c