diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-06-17 21:33:47 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-21 17:39:35 -0600 |
commit | 682c9f8dfc47df94df061df58345d84f69be0a34 (patch) | |
tree | 854a605f9a62f93e123cd28b0ae7020b21a34759 | |
parent | 9eb72dd1f4a7d4b6996a2b2ebf8d9a72ef78a998 (diff) | |
download | u-boot-imx-682c9f8dfc47df94df061df58345d84f69be0a34.zip u-boot-imx-682c9f8dfc47df94df061df58345d84f69be0a34.tar.gz u-boot-imx-682c9f8dfc47df94df061df58345d84f69be0a34.tar.bz2 |
usb: Pass device instead of portnr to usb_legacy_port_reset
Pass the usb_device instead of the portnr to usb_legacy_port_reset and
rename it to usb_hub_port_reset as there is nothing legacy about it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/usb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/usb.c b/common/usb.c index d237478..d204ba2 100644 --- a/common/usb.c +++ b/common/usb.c @@ -911,16 +911,16 @@ __weak int usb_alloc_device(struct usb_device *udev) } #endif /* !CONFIG_DM_USB */ -static int usb_legacy_port_reset(struct usb_device *hub, int portnr) +static int usb_hub_port_reset(struct usb_device *dev, struct usb_device *hub) { if (hub) { unsigned short portstatus; int err; /* reset the port for the second time */ - err = legacy_hub_port_reset(hub, portnr - 1, &portstatus); + err = legacy_hub_port_reset(hub, dev->portnr - 1, &portstatus); if (err < 0) { - printf("\n Couldn't reset port %i\n", portnr); + printf("\n Couldn't reset port %i\n", dev->portnr); return err; } } else { @@ -1048,7 +1048,7 @@ static int usb_prepare_device(struct usb_device *dev, int addr, bool do_read, err = usb_setup_descriptor(dev, do_read); if (err) return err; - err = usb_legacy_port_reset(parent, dev->portnr); + err = usb_hub_port_reset(dev, parent); if (err) return err; |