[U-Boot] [PATCH] dm: usb: fix missing errno include regression

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>

Hi Marcel,
On 3 August 2015 at 09:33, Marcel Ziswiler marcel@ziswiler.com wrote:
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(+)
Can I please check if you have based this on dm/master? I applied some of the patches there and hope to get the rest in over the next week.
Regards, Simon

On Mon, 2015-08-03 at 09:38 -0600, Simon Glass wrote:
Can I please check if you have based this on dm/master? I applied some of the patches there and hope to get the rest in over the next week.
I doubled checked the mailing list but could not find any relevant stuff. But admittedly I haven't tried dm/master yet.
OK, looks like dm/master at least compiles but has the same reception issues still:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/228636
Thanks Simon

+Stephen
Hi Marcel,
On 3 August 2015 at 09:53, Marcel Ziswiler marcel.ziswiler@toradex.com wrote:
On Mon, 2015-08-03 at 09:38 -0600, Simon Glass wrote:
Can I please check if you have based this on dm/master? I applied some of the patches there and hope to get the rest in over the next week.
I doubled checked the mailing list but could not find any relevant stuff. But admittedly I haven't tried dm/master yet.
OK, looks like dm/master at least compiles but has the same reception issues still:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/228636
OK but I can't see how this is a regression. It hasn't worked before.
I sent a series to enable this for Asix (which worked for me on minnowmax) and SMSC (which worked for me on Raspberry Pi). They should both be in dm/master (minus actually enabling it on rpi which is still in discussion with Stephen) so any bugs you see now are real! If you are able to figure it out (cache alignment problem?) please send a patch.
Regards, Simon
participants (3)
-
Marcel Ziswiler
-
Marcel Ziswiler
-
Simon Glass