mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
usb: ether: call _usb_eth_halt() if initialization fails
If the host does not respond in time, the initialization fails. However the usb ether driver will still be registered. This will make usb_gadget_probe_driver() fail the next time the initialization is attempted because it cannot find an available UDC. Fixing this by calling _usb_eth_halt() when the init fails. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Acked-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
parent
a36c70a36d
commit
1c1464c2b1
1 changed files with 4 additions and 1 deletions
|
@ -2333,6 +2333,8 @@ fail:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
static void _usb_eth_halt(struct ether_priv *priv);
|
||||||
|
|
||||||
static int _usb_eth_init(struct ether_priv *priv)
|
static int _usb_eth_init(struct ether_priv *priv)
|
||||||
{
|
{
|
||||||
struct eth_dev *dev = &priv->ethdev;
|
struct eth_dev *dev = &priv->ethdev;
|
||||||
|
@ -2406,6 +2408,7 @@ static int _usb_eth_init(struct ether_priv *priv)
|
||||||
rx_submit(dev, dev->rx_req, 0);
|
rx_submit(dev, dev->rx_req, 0);
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
|
_usb_eth_halt(priv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2485,7 +2488,7 @@ static int _usb_eth_recv(struct ether_priv *priv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _usb_eth_halt(struct ether_priv *priv)
|
static void _usb_eth_halt(struct ether_priv *priv)
|
||||||
{
|
{
|
||||||
struct eth_dev *dev = &priv->ethdev;
|
struct eth_dev *dev = &priv->ethdev;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue