diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-23 08:26:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-25 00:00:33 -0500 |
commit | 6ae706aeaf42cd2fe6e541c72af6e2c0befe057c (patch) | |
tree | 8f46239ee249ebb38b5a27663cad8f0183ec572c | |
parent | 69ab55d7be6c3d69fa2e38f2a2bed4e91b9edf8d (diff) |
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>
-rw-r--r-- | drivers/usb/core/hcd.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 2 | ||||
-rw-r--r-- | drivers/usb/wusbcore/wusbhc.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 9af9506352f3..232c8c93dd3a 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -2237,7 +2237,7 @@ int usb_hcd_get_frame_number (struct usb_device *udev) | |||
2237 | 2237 | ||
2238 | int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg) | 2238 | int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg) |
2239 | { | 2239 | { |
2240 | struct usb_hcd *hcd = container_of(rhdev->bus, struct usb_hcd, self); | 2240 | struct usb_hcd *hcd = bus_to_hcd(rhdev->bus); |
2241 | int status; | 2241 | int status; |
2242 | int old_state = hcd->state; | 2242 | int old_state = hcd->state; |
2243 | 2243 | ||
@@ -2286,7 +2286,7 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg) | |||
2286 | 2286 | ||
2287 | int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) | 2287 | int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) |
2288 | { | 2288 | { |
2289 | struct usb_hcd *hcd = container_of(rhdev->bus, struct usb_hcd, self); | 2289 | struct usb_hcd *hcd = bus_to_hcd(rhdev->bus); |
2290 | int status; | 2290 | int status; |
2291 | int old_state = hcd->state; | 2291 | int old_state = hcd->state; |
2292 | 2292 | ||
@@ -2400,7 +2400,7 @@ int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num) | |||
2400 | * boards with root hubs hooked up to internal devices (instead of | 2400 | * boards with root hubs hooked up to internal devices (instead of |
2401 | * just the OTG port) may need more attention to resetting... | 2401 | * just the OTG port) may need more attention to resetting... |
2402 | */ | 2402 | */ |
2403 | hcd = container_of (bus, struct usb_hcd, self); | 2403 | hcd = bus_to_hcd(bus); |
2404 | if (port_num && hcd->driver->start_port_reset) | 2404 | if (port_num && hcd->driver->start_port_reset) |
2405 | status = hcd->driver->start_port_reset(hcd, port_num); | 2405 | status = hcd->driver->start_port_reset(hcd, port_num); |
2406 | 2406 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 3c9b22eb78ca..9ec5733b62f4 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2659,7 +2659,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub) | |||
2659 | struct usb_hcd *hcd; | 2659 | struct usb_hcd *hcd; |
2660 | if (hub->hdev->parent != NULL) /* not a root hub? */ | 2660 | if (hub->hdev->parent != NULL) /* not a root hub? */ |
2661 | return 0; | 2661 | return 0; |
2662 | hcd = container_of(hub->hdev->bus, struct usb_hcd, self); | 2662 | hcd = bus_to_hcd(hub->hdev->bus); |
2663 | return hcd->wireless; | 2663 | return hcd->wireless; |
2664 | } | 2664 | } |
2665 | 2665 | ||
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 49b011f951b3..16ade41759cd 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -397,7 +397,7 @@ struct device_type usb_device_type = { | |||
397 | /* Returns 1 if @usb_bus is WUSB, 0 otherwise */ | 397 | /* Returns 1 if @usb_bus is WUSB, 0 otherwise */ |
398 | static unsigned usb_bus_is_wusb(struct usb_bus *bus) | 398 | static unsigned usb_bus_is_wusb(struct usb_bus *bus) |
399 | { | 399 | { |
400 | struct usb_hcd *hcd = container_of(bus, struct usb_hcd, self); | 400 | struct usb_hcd *hcd = bus_to_hcd(bus); |
401 | return hcd->wireless; | 401 | return hcd->wireless; |
402 | } | 402 | } |
403 | 403 | ||
diff --git a/drivers/usb/wusbcore/wusbhc.h b/drivers/usb/wusbcore/wusbhc.h index 41838db7f85c..8c5bd000739b 100644 --- a/drivers/usb/wusbcore/wusbhc.h +++ b/drivers/usb/wusbcore/wusbhc.h | |||
@@ -336,7 +336,7 @@ static inline | |||
336 | struct usb_hcd *usb_hcd_get_by_usb_dev(struct usb_device *usb_dev) | 336 | struct usb_hcd *usb_hcd_get_by_usb_dev(struct usb_device *usb_dev) |
337 | { | 337 | { |
338 | struct usb_hcd *usb_hcd; | 338 | struct usb_hcd *usb_hcd; |
339 | usb_hcd = container_of(usb_dev->bus, struct usb_hcd, self); | 339 | usb_hcd = bus_to_hcd(usb_dev->bus); |
340 | return usb_get_hcd(usb_hcd); | 340 | return usb_get_hcd(usb_hcd); |
341 | } | 341 | } |
342 | 342 | ||