[PATCH v6 05/20] usb: ether: Fix error handling in usb_ether_init

Simon Glass sjg at chromium.org
Mon Oct 17 23:29:22 CEST 2022


The code checks the return value from uclass_first_device as well as
that the device exists but it passes on the return value which may be
zero if there are no gadget devices. Just check that a device was
returned and return -ENODEV otherwise.

Also remove the dev variable which is not really used for anything.

Signed-off-by: Michal Suchanek <msuchanek at suse.de>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 drivers/usb/gadget/ether.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list