All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Wrong place to manage endianess for usbdev?
Date: Fri, 4 May 2007 16:39:01 +0200	[thread overview]
Message-ID: <20070504143901.GA11070@enneenne.com> (raw)

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

-- 

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

                 reply	other threads:[~2007-05-04 14:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070504143901.GA11070@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.