From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rodolfo Giometti Date: Fri, 4 May 2007 16:39:01 +0200 Subject: [U-Boot-Users] Wrong place to manage endianess for usbdev? Message-ID: <20070504143901.GA11070@enneenne.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, I suppose is better using this patch: diff --git a/include/usbdcore.h b/include/usbdcore.h index cb2be72..72b9af2 100644 --- a/include/usbdcore.h +++ b/include/usbdcore.h @@ -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: diff --git a/drivers/usbtty.h b/drivers/usbtty.h index 8154e30..051ead7 100644 --- a/drivers/usbtty.h +++ b/drivers/usbtty.h @@ -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 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. -- 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