]> git.baikalelectronics.ru Git - uboot.git/commit
usb: ether: Fix error handling in usb_ether_init
authorMichal Suchanek <msuchanek@suse.de>
Wed, 12 Oct 2022 19:57:54 +0000 (21:57 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Oct 2022 03:17:12 +0000 (21:17 -0600)
commit8f11b0cbc52172125482901ddfd84aebf36417fe
tree2989e9d64589c76404fec6e225a17d99987a8dac
parent85ce73ad5bb86509faf1cfe03f1ec495d8f66777
usb: ether: Fix error handling in usb_ether_init

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@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/usb/gadget/ether.c