mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
usb: usb_setup_device: Drop unneeded portnr function argument
Drop the unneeded portnr function argument, the portnr is part of the usb_device struct which is passed via the dev argument. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
6bfe80e754
commit
9eb72dd1f4
3 changed files with 9 additions and 9 deletions
10
common/usb.c
10
common/usb.c
|
@ -1030,7 +1030,7 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
|
|||
}
|
||||
|
||||
static int usb_prepare_device(struct usb_device *dev, int addr, bool do_read,
|
||||
struct usb_device *parent, int portnr)
|
||||
struct usb_device *parent)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -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, portnr);
|
||||
err = usb_legacy_port_reset(parent, dev->portnr);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@ -1126,7 +1126,7 @@ int usb_select_config(struct usb_device *dev)
|
|||
}
|
||||
|
||||
int usb_setup_device(struct usb_device *dev, bool do_read,
|
||||
struct usb_device *parent, int portnr)
|
||||
struct usb_device *parent)
|
||||
{
|
||||
int addr;
|
||||
int ret;
|
||||
|
@ -1135,7 +1135,7 @@ int usb_setup_device(struct usb_device *dev, bool do_read,
|
|||
addr = dev->devnum;
|
||||
dev->devnum = 0;
|
||||
|
||||
ret = usb_prepare_device(dev, addr, do_read, parent, portnr);
|
||||
ret = usb_prepare_device(dev, addr, do_read, parent);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = usb_select_config(dev);
|
||||
|
@ -1165,7 +1165,7 @@ int usb_new_device(struct usb_device *dev)
|
|||
#ifdef CONFIG_USB_XHCI
|
||||
do_read = false;
|
||||
#endif
|
||||
err = usb_setup_device(dev, do_read, dev->parent, dev->portnr);
|
||||
err = usb_setup_device(dev, do_read, dev->parent);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
|
@ -565,7 +565,7 @@ int usb_scan_device(struct udevice *parent, int port,
|
|||
debug("Calling usb_setup_device(), portnr=%d\n", udev->portnr);
|
||||
parent_udev = device_get_uclass_id(parent) == UCLASS_USB_HUB ?
|
||||
dev_get_parentdata(parent) : NULL;
|
||||
ret = usb_setup_device(udev, priv->desc_before_addr, parent_udev, port);
|
||||
ret = usb_setup_device(udev, priv->desc_before_addr, parent_udev);
|
||||
debug("read_descriptor for '%s': ret=%d\n", parent->name, ret);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -734,14 +734,14 @@ struct usb_device *usb_get_dev_index(struct udevice *bus, int index);
|
|||
*
|
||||
* @dev: USB device pointer. This need not be a real device - it is
|
||||
* common for it to just be a local variable with its ->dev
|
||||
* member (i.e. @dev->dev) set to the parent device
|
||||
* member (i.e. @dev->dev) set to the parent device and
|
||||
* dev->portnr set to the port number on the hub (1=first)
|
||||
* @do_read: true to read the device descriptor before an address is set
|
||||
* (should be false for XHCI buses, true otherwise)
|
||||
* @parent: Parent device (either UCLASS_USB or UCLASS_USB_HUB)
|
||||
* @portnr: Port number on hub (1=first) or 0 for none
|
||||
* @return 0 if OK, -ve on error */
|
||||
int usb_setup_device(struct usb_device *dev, bool do_read,
|
||||
struct usb_device *parent, int portnr);
|
||||
struct usb_device *parent);
|
||||
|
||||
/**
|
||||
* usb_hub_scan() - Scan a hub and find its devices
|
||||
|
|
Loading…
Reference in a new issue