mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fix IORESOURCE_MEM_xxx usage in dm9k driver
@ 2016-06-25  3:53 zzs213
  2016-06-27  7:47 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: zzs213 @ 2016-06-25  3:53 UTC (permalink / raw)
  To: barebox

From: 张忠山 <zzs213@126.com>

Because the const used in dm9k driver unmatch the new IORESOURCE_MEM_xxx
macro. So whenever the driver start probe, the flowwing error message
appear:

        Wrong io resource size

This patch fix this.

Signed-off-by: 张忠山 <zzs213@126.com>
---
 drivers/net/dm9k.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/net/dm9k.c b/drivers/net/dm9k.c
index ad402e3..7a41868 100644
--- a/drivers/net/dm9k.c
+++ b/drivers/net/dm9k.c
@@ -732,14 +732,10 @@ static int dm9k_init_dev(struct eth_device *edev)
 static int dm9000_setup_buswidth(struct device_d *dev, struct dm9k *priv, uint32_t width)
 {
 	switch (width) {
-	case 1:
-		priv->buswidth = IORESOURCE_MEM_8BIT;
-		break;
-	case 2:
-		priv->buswidth = IORESOURCE_MEM_16BIT;
-		break;
-	case 4:
-		priv->buswidth = IORESOURCE_MEM_32BIT;
+	case IORESOURCE_MEM_8BIT:
+	case IORESOURCE_MEM_16BIT:
+	case IORESOURCE_MEM_32BIT:
+		priv->buswidth = width;
 		break;
 	default:
 		dev_err(dev, "Wrong io resource size\n");
@@ -765,7 +761,7 @@ static int dm9000_parse_dt(struct device_d *dev, struct dm9k *priv)
 
 	if (of_property_read_u32(np, "reg-io-width", &prop)) {
 		/* Use 8-bit registers by default */
-		prop = 1;
+		prop = IORESOURCE_MEM_8BIT;
 	}
 
 	return dm9000_setup_buswidth(dev, priv, prop);
-- 
1.9.1



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-27  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-25  3:53 [PATCH] fix IORESOURCE_MEM_xxx usage in dm9k driver zzs213
2016-06-27  7:47 ` Sascha Hauer
2016-06-27  8:18   ` 张忠山
2016-06-27  8:20   ` 张忠山
2016-06-27  8:21   ` 张忠山

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox