summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-05-05 11:54:33 +0200
committerSimon Glass <sjg@chromium.org>2015-05-05 20:58:41 -0600
commit25c8ebdfcd9b2fca08ccf6bcc37de9ba388ad458 (patch)
tree455e64c266f166da4ccbdf7d06d2be4b350c936e /drivers/usb/host
parent7f1a07538f71b2b0f37744bdc899be294e0518b5 (diff)
downloadu-boot-imx-25c8ebdfcd9b2fca08ccf6bcc37de9ba388ad458.zip
u-boot-imx-25c8ebdfcd9b2fca08ccf6bcc37de9ba388ad458.tar.gz
u-boot-imx-25c8ebdfcd9b2fca08ccf6bcc37de9ba388ad458.tar.bz2
dm: usb: Use usb_get_bus in dm ehci code
Use usb_get_bus in dm ehci code rather then re-implementing it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-hcd.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bd9861d..85adbf4 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -125,14 +125,7 @@ static struct descriptor {
static struct ehci_ctrl *ehci_get_ctrl(struct usb_device *udev)
{
#ifdef CONFIG_DM_USB
- struct udevice *dev;
-
- /* Find the USB controller */
- for (dev = udev->dev;
- device_get_uclass_id(dev) != UCLASS_USB;
- dev = dev->parent)
- ;
- return dev_get_priv(dev);
+ return dev_get_priv(usb_get_bus(udev->dev));
#else
return udev->controller;
#endif