Skip to content
Commit 2cb43ef1 authored by Michal Suchanek's avatar Michal Suchanek Committed by Simon Glass
Browse files

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: default avatarMichal Suchanek <msuchanek@suse.de>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 28a22cd9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment