mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/7] dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT
Date: Fri, 29 Jul 2011 07:52:53 +0200	[thread overview]
Message-ID: <1311918777-26719-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1311918777-26719-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9261ek/init.c |    2 +-
 arch/arm/boards/mini2440/mini2440.c  |    2 +-
 arch/arm/boards/pm9261/init.c        |    2 +-
 arch/arm/boards/scb9328/scb9328.c    |    2 +-
 drivers/net/dm9000.c                 |   12 ++++++------
 include/dm9000.h                     |    4 ----
 6 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index 4009523..812b399 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -89,7 +89,7 @@ static void ek_add_device_nand(void)
  */
 #if defined(CONFIG_DRIVER_NET_DM9000)
 static struct dm9000_platform_data dm9000_data = {
-	.buswidth	= DM9000_WIDTH_16,
+	.buswidth	= IORESOURCE_MEM_16BIT,
 	.srom		= 0,
 };
 
diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c
index 2d27b00..634e035 100644
--- a/arch/arm/boards/mini2440/mini2440.c
+++ b/arch/arm/boards/mini2440/mini2440.c
@@ -63,7 +63,7 @@ static struct device_d nand_dev = {
  * Area 2: Offset 0x304...0x307
  */
 static struct dm9000_platform_data dm9000_data = {
-	.buswidth = DM9000_WIDTH_16,
+	.buswidth = IORESOURCE_MEM_16BIT,
 	.srom     = 1,
 };
 
diff --git a/arch/arm/boards/pm9261/init.c b/arch/arm/boards/pm9261/init.c
index 1059aec..fa21e24 100644
--- a/arch/arm/boards/pm9261/init.c
+++ b/arch/arm/boards/pm9261/init.c
@@ -89,7 +89,7 @@ static void pm_add_device_nand(void)
  */
 #if defined(CONFIG_DRIVER_NET_DM9000)
 static struct dm9000_platform_data dm9000_data = {
-	.buswidth	= DM9000_WIDTH_16,
+	.buswidth	= IORESOURCE_MEM_16BIT,
 	.srom		= 1,
 };
 
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index d49eaff..47aa8ce 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -34,7 +34,7 @@
 #include <led.h>
 
 static struct dm9000_platform_data dm9000_data = {
-	.buswidth = DM9000_WIDTH_16,
+	.buswidth = IORESOURCE_MEM_16BIT,
 	.srom     = 1,
 };
 
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index b867d21..691d877 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -294,16 +294,16 @@ static int dm9000_eth_send (struct eth_device *edev,
 	writeb(DM9000_MWCMD, priv->iobase);
 
 	switch (priv->buswidth) {
-	case DM9000_WIDTH_8:
+	case IORESOURCE_MEM_8BIT:
 		for (i = 0; i < length; i++)
 			writeb(data_ptr[i] & 0xff, priv->iodata);
 		break;
-	case DM9000_WIDTH_16:
+	case IORESOURCE_MEM_16BIT:
 		tmplen = (length + 1) / 2;
 		for (i = 0; i < tmplen; i++)
 			writew(((u16 *)data_ptr)[i], priv->iodata);
 		break;
-	case DM9000_WIDTH_32:
+	case IORESOURCE_MEM_32BIT:
 		tmplen = (length + 3) / 4;
 		for (i = 0; i < tmplen; i++)
 			writel(((u32 *) data_ptr)[i], priv->iodata);
@@ -371,20 +371,20 @@ static int dm9000_eth_rx (struct eth_device *edev)
 	/* Move data from DM9000 */
 	/* Read received packet from RX SRAM */
 	switch (priv->buswidth) {
-	case DM9000_WIDTH_8:
+	case IORESOURCE_MEM_8BIT:
 		RxStatus = readb(priv->iodata) + (readb(priv->iodata) << 8);
 		RxLen = readb(priv->iodata) + (readb(priv->iodata) << 8);
 		for (i = 0; i < RxLen; i++)
 			rdptr[i] = readb(priv->iodata);
 		break;
-	case DM9000_WIDTH_16:
+	case IORESOURCE_MEM_16BIT:
 		RxStatus = readw(priv->iodata);
 		RxLen = readw(priv->iodata);
 		tmplen = (RxLen + 1) / 2;
 		for (i = 0; i < tmplen; i++)
 			((u16 *) rdptr)[i] = readw(priv->iodata);
 		break;
-	case DM9000_WIDTH_32:
+	case IORESOURCE_MEM_32BIT:
 		tmpdata = readl(priv->iodata);
 		RxStatus = tmpdata;
 		RxLen = tmpdata >> 16;
diff --git a/include/dm9000.h b/include/dm9000.h
index 0991ab5..c4618f1 100644
--- a/include/dm9000.h
+++ b/include/dm9000.h
@@ -2,10 +2,6 @@
 #ifndef __DM9000_H__
 #define __DM9000_H__
 
-#define DM9000_WIDTH_8		1
-#define DM9000_WIDTH_16		2
-#define DM9000_WIDTH_32		3
-
 struct dm9000_platform_data {
 	int buswidth;
 	int srom;
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-07-29  6:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  5:52 [PATCH 1/7] generic_memmap_ro/rw: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  5:52 ` [PATCH 2/7] devinfo: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  5:52 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-07-29  5:52 ` [PATCH 4/7] dm9000: introduce add_dm9000_device to register dm9000 device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  5:52 ` [PATCH 5/7] resource: introduce add_usb_ehci_device to register echi device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  9:52   ` Sascha Hauer
2011-07-29 12:17     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  5:52 ` [PATCH 6/7] omap: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  7:07   ` Franck JULLIEN
2011-07-29 13:36     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  5:52 ` [PATCH 7/7] fb: switch to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 10:22 ` [PATCH 1/7] generic_memmap_ro/rw: switch to resource Marc Kleine-Budde
2011-07-29 10:57 ` Sascha Hauer
2011-07-29 13:40   ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:53 [PULL] final switch to resoruce Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 3/7] dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT Jean-Christophe PLAGNIOL-VILLARD

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=1311918777-26719-3-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox