mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
usb: hub: Remove hub_port_reset()
At present hub_port_reset() is defined in DM USB, but it is never called hence remove it (removing another ifdefs). While we are here, change legacy_hub_port_reset() name to usb_hub_port_reset() to better match other function names in the same hub module. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -207,7 +207,17 @@ static inline char *portspeed(int portstatus)
|
|||||||
return speed_str;
|
return speed_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
int legacy_hub_port_reset(struct usb_device *dev, int port,
|
/**
|
||||||
|
* usb_hub_port_reset() - reset a port given its usb_device pointer
|
||||||
|
*
|
||||||
|
* Reset a hub port and see if a device is present on that port, providing
|
||||||
|
* sufficient time for it to show itself. The port status is returned.
|
||||||
|
*
|
||||||
|
* @dev: USB device to reset
|
||||||
|
* @port: Port number to reset (note ports are numbered from 0 here)
|
||||||
|
* @portstat: Returns port status
|
||||||
|
*/
|
||||||
|
static int usb_hub_port_reset(struct usb_device *dev, int port,
|
||||||
unsigned short *portstat)
|
unsigned short *portstat)
|
||||||
{
|
{
|
||||||
int err, tries;
|
int err, tries;
|
||||||
@@ -281,15 +291,6 @@ int legacy_hub_port_reset(struct usb_device *dev, int port,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DM_USB
|
|
||||||
int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat)
|
|
||||||
{
|
|
||||||
struct usb_device *udev = dev_get_parent_priv(dev);
|
|
||||||
|
|
||||||
return legacy_hub_port_reset(udev, port, portstat);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int usb_hub_port_connect_change(struct usb_device *dev, int port)
|
int usb_hub_port_connect_change(struct usb_device *dev, int port)
|
||||||
{
|
{
|
||||||
ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
|
ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
|
||||||
@@ -323,7 +324,7 @@ int usb_hub_port_connect_change(struct usb_device *dev, int port)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the port */
|
/* Reset the port */
|
||||||
ret = legacy_hub_port_reset(dev, port, &portstatus);
|
ret = usb_hub_port_reset(dev, port, &portstatus);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret != -ENXIO)
|
if (ret != -ENXIO)
|
||||||
printf("cannot reset port %i!?\n", port + 1);
|
printf("cannot reset port %i!?\n", port + 1);
|
||||||
|
@@ -871,24 +871,6 @@ bool usb_device_has_child_on_port(struct usb_device *parent, int port);
|
|||||||
int usb_hub_probe(struct usb_device *dev, int ifnum);
|
int usb_hub_probe(struct usb_device *dev, int ifnum);
|
||||||
void usb_hub_reset(void);
|
void usb_hub_reset(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* legacy_hub_port_reset() - reset a port given its usb_device pointer
|
|
||||||
*
|
|
||||||
* Reset a hub port and see if a device is present on that port, providing
|
|
||||||
* sufficient time for it to show itself. The port status is returned.
|
|
||||||
*
|
|
||||||
* With driver model this moves to hub_port_reset() and is passed a struct
|
|
||||||
* udevice.
|
|
||||||
*
|
|
||||||
* @dev: USB device to reset
|
|
||||||
* @port: Port number to reset (note ports are numbered from 0 here)
|
|
||||||
* @portstat: Returns port status
|
|
||||||
*/
|
|
||||||
int legacy_hub_port_reset(struct usb_device *dev, int port,
|
|
||||||
unsigned short *portstat);
|
|
||||||
|
|
||||||
int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* usb_find_usb2_hub_address_port() - Get hub address and port for TT setting
|
* usb_find_usb2_hub_address_port() - Get hub address and port for TT setting
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user