mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
USB: core, wusbcore: use bus_to_hcd
Use bus_to_hcd() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
69ab55d7be
commit
6ae706aeaf
@@ -2237,7 +2237,7 @@ int usb_hcd_get_frame_number (struct usb_device *udev)
|
||||
|
||||
int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg)
|
||||
{
|
||||
struct usb_hcd *hcd = container_of(rhdev->bus, struct usb_hcd, self);
|
||||
struct usb_hcd *hcd = bus_to_hcd(rhdev->bus);
|
||||
int status;
|
||||
int old_state = hcd->state;
|
||||
|
||||
@@ -2286,7 +2286,7 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg)
|
||||
|
||||
int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg)
|
||||
{
|
||||
struct usb_hcd *hcd = container_of(rhdev->bus, struct usb_hcd, self);
|
||||
struct usb_hcd *hcd = bus_to_hcd(rhdev->bus);
|
||||
int status;
|
||||
int old_state = hcd->state;
|
||||
|
||||
@@ -2400,7 +2400,7 @@ int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num)
|
||||
* boards with root hubs hooked up to internal devices (instead of
|
||||
* just the OTG port) may need more attention to resetting...
|
||||
*/
|
||||
hcd = container_of (bus, struct usb_hcd, self);
|
||||
hcd = bus_to_hcd(bus);
|
||||
if (port_num && hcd->driver->start_port_reset)
|
||||
status = hcd->driver->start_port_reset(hcd, port_num);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user