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 c605f3cd ("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: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NPetr Mladek <pmladek@suse.cz> Acked-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
想要评论请 注册 或 登录