commit | a18b6a57ab36add1b3934b478bba9feddeeff1d4 | [log] [tgz] |
---|---|---|
author | Michal Suchanek <msuchanek@suse.de> | Wed Oct 12 21:57:54 2022 +0200 |
committer | Simon Glass <sjg@chromium.org> | Mon Oct 17 21:17:12 2022 -0600 |
tree | 2989e9d64589c76404fec6e225a17d99987a8dac | |
parent | 675e90886925470c4fe9f2fa85f9cf5ea3c4b630 [diff] |
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>