
From: Marcel Ziswiler marcel.ziswiler@toradex.com
If enabling CONFIG_DM_ETH currently compilation fails as follows:
drivers/usb/eth/usb_ether.c: In function 'usb_ether_register': drivers/usb/eth/usb_ether.c:72:11: error: 'ENXIO' undeclared (first use in this function) return -ENXIO; ^ drivers/usb/eth/usb_ether.c:72:11: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/eth/usb_ether.c:78:11: error: 'ENOMEM' undeclared (first use in this function) return -ENOMEM; ^ drivers/usb/eth/usb_ether.c: In function 'usb_ether_receive': drivers/usb/eth/usb_ether.c:102:11: error: 'EINVAL' undeclared (first use in this function) return -EINVAL; ^ drivers/usb/eth/usb_ether.c:114:11: error: 'ENOSPC' undeclared (first use in this function) return -ENOSPC; ^ drivers/usb/eth/usb_ether.c:119:27: error: 'EAGAIN' undeclared (first use in this function) return actual_len ? 0 : -EAGAIN; ^ drivers/usb/eth/usb_ether.c:120:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ scripts/Makefile.build:277: recipe for target 'drivers/usb/eth/usb_ether.o' failed make[2]: *** [drivers/usb/eth/usb_ether.o] Error 1
drivers/usb/eth/asix.c: In function 'asix_eth_recv': drivers/usb/eth/asix.c:763:12: error: 'EAGAIN' undeclared (first use in this function) return -EAGAIN; ^ drivers/usb/eth/asix.c:763:12: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/eth/asix.c:799:10: error: 'EINVAL' undeclared (first use in this function) return -EINVAL; ^ CC drivers/usb/host/usb-uclass.o drivers/usb/eth/asix.c: In function 'asix_write_hwaddr': drivers/usb/eth/asix.c:819:11: error: 'ENOSYS' undeclared (first use in this function) return -ENOSYS; ^ drivers/usb/eth/asix.c: In function 'asix_eth_recv': drivers/usb/eth/asix.c:800:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ scripts/Makefile.build:277: recipe for target 'drivers/usb/eth/asix.o' failed make[2]: *** [drivers/usb/eth/asix.o] Error 1
This is a regression of the following:
commit c8c2797c381054beaf3de89027af92a0b84b36cc dm: usb: eth: Support driver model with USB Ethernet
and:
commit fbc4b8af469459425de72530dbded0ddbe157004 dm: usb: eth: Add driver-model support to the asix driver
Tested by enabling CONFIG_DM_ETH on Colibri T20/T30 as well as Apalis T30 with CONFIG_USB_HOST_ETHER and CONFIG_USB_ETHER_ASIX enabled and a LevelOne USB-0301 ASIX AX88772 dongle.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com --- Note: While enabling CONFIG_DM_ETH now compiles it doesn't quite work due to reception issues which I will report in a separate email.
drivers/usb/eth/asix.c | 1 + drivers/usb/eth/usb_ether.c | 1 + 2 files changed, 2 insertions(+)
diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c index 72ec41e..ac14ee9 100644 --- a/drivers/usb/eth/asix.c +++ b/drivers/usb/eth/asix.c @@ -6,6 +6,7 @@
#include <common.h> #include <dm.h> +#include <errno.h> #include <usb.h> #include <malloc.h> #include <linux/mii.h> diff --git a/drivers/usb/eth/usb_ether.c b/drivers/usb/eth/usb_ether.c index 63785a9..3c3e082 100644 --- a/drivers/usb/eth/usb_ether.c +++ b/drivers/usb/eth/usb_ether.c @@ -6,6 +6,7 @@
#include <common.h> #include <dm.h> +#include <errno.h> #include <malloc.h> #include <usb.h> #include <dm/device-internal.h>