From: Stefan Roese Date: Fri, 26 Mar 2021 07:25:24 +0100 Subject: [PATCH] usb: eth: add print of device name on usb_ether registration In-Reply-To: <20210325165639.20876-1-tharvey@gateworks.com> References: <20210325165639.20876-1-tharvey@gateworks.com> Message-ID: <68d13a60-3bbc-2182-efb5-86360ad12fa5@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 25.03.21 17:56, Tim Harvey wrote: > When a USB Ethernet device is detected and registered there is no > way to know the device-name in order to use it with the ethact > env variable. > > Add a print to display the device name that is registered. Nice. I've also stumbled upon this problem a few times but always failed to implement such a small "fix". > Example using an AX88x72A USB Ethernet device: > > GW6404-B> usb start > starting USB... > Bus xhci_pci: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.00 > Bus xhci_pci: Register 2000140 NbrPorts 2 > Starting the controller > USB XHCI 1.00 > scanning bus xhci_pci for devices... > ? ? ? ?found ethernet device: asix_eth > > GW6404-B> setenv ethact asix_eth # select usb ethernet > > Signed-off-by: Tim Harvey Reviewed-by: Stefan Roese Thanks, Stefan > --- > drivers/usb/eth/usb_ether.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/eth/usb_ether.c b/drivers/usb/eth/usb_ether.c > index e368ecda0d..916c4e1c85 100644 > --- a/drivers/usb/eth/usb_ether.c > +++ b/drivers/usb/eth/usb_ether.c > @@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) > return ret; > } > ueth->pusb_dev = udev; > + printf("\n? ? ? ?found ethernet device: %s\n", dev->name); > > return 0; > } > Viele Gr??e, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de