From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Tue, 22 Jan 2019 23:37:10 +0100 Subject: [U-Boot] [PATCH v1 1/4] usb: ether: call _usb_eth_halt() if initialization fails In-Reply-To: <20190122154819.3171-2-jjhiblot@ti.com> References: <20190122154819.3171-1-jjhiblot@ti.com> <20190122154819.3171-2-jjhiblot@ti.com> Message-ID: <20190122233710.5a386877@jawa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jean-Jacques, > 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. Acked-by: Lukasz Majewski > > Signed-off-by: Jean-Jacques Hiblot > --- > > drivers/usb/gadget/ether.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c > index 3b3d9af681..57edaa3ac8 100644 > --- a/drivers/usb/gadget/ether.c > +++ b/drivers/usb/gadget/ether.c > @@ -2333,6 +2333,8 @@ fail: > } > > /*-------------------------------------------------------------------------*/ > +static void _usb_eth_halt(struct ether_priv *priv); > + > static int _usb_eth_init(struct ether_priv *priv) > { > 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); > return 0; > fail: > + _usb_eth_halt(priv); > return -1; > } > > @@ -2485,7 +2488,7 @@ static int _usb_eth_recv(struct ether_priv > *priv) 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; > Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: