Skip to contentSkip to conversation

Wrong place to manage endianess for usbdev?

U-Boot-Users Rodolfo Giometti 1 participant 1 message May 4, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

I suppose is better using this patch:

include/usbdcore.h +0 -4
index cb2be72..72b9af2 100644
@@ -56,10 +56,6 @@
 #define usbinfo(fmt,args...) do{}while(0)
 #endif
 
-#ifndef le16_to_cpu
-#define le16_to_cpu(x) (x)
-#endif
-
 #ifndef inb
 #define inb(p)      (*(volatile u8*)(p))
 #endif

Since defining le16_to_cpu() here is wrong. Each usbdevice driver should be free of using itsown endianess definition.

In fact for my new driver I added:

drivers/usbtty.h +2 -0
index 8154e30..051ead7 100644
@@ -27,6 +27,8 @@
 #include "usbdcore.h"
 #if defined(CONFIG_PPC)
 #include "usbdcore_mpc8xx.h"
+#elif defined(CONFIG_PXA27X)
+#include "usbdcore_pxa27x.h"
 #elif defined(CONFIG_ARM)
 #include "usbdcore_omap1510.h"
 #endif

and inside usbdcore_pxa27x.h I use:

#include <asm/byteorder.h>

Ciao,

Rodolfo

P.S. Please note also that using CONFIG_ARM to include usbdcore_omap1510.h is not the best... I think it should be replaced with a proper CONFIG option.

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127