Skip to contentSkip to conversation

dm: usb: fix missing errno include regression

PATCH New Marcel Ziswiler 3 participants 4 messages Aug 3, 2015 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm: usb: fix missing errno include regression

From: Marcel Ziswiler <[email protected]>

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.

---
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(+)
drivers/usb/eth/asix.c +1 -0
index 72ec41e..ac14ee9 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <errno.h>
 #include <usb.h>
 #include <malloc.h>
 #include <linux/mii.h>
drivers/usb/eth/usb_ether.c +1 -0
index 63785a9..3c3e082 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <errno.h>
 #include <malloc.h>
 #include <usb.h>
 #include <dm/device-internal.h>
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 dm: usb: fix missing errno include regression

Hi Marcel,

Quoted 76 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

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.

Quoted 8 lines

---
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

#2 lore raw

PATCH 1/1 dm: usb: fix missing errno include regression

Quoted 3 lines · Simon Glass

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

#3 lore raw

PATCH 1/1 dm: usb: fix missing errno include regression

+Stephen

Hi Marcel,

Quoted 6 lines · Marcel Ziswiler
Quoted 3 lines · Simon Glass

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.

Quoted 7 lines

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