mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: zzs213@126.com
To: barebox@lists.infradead.org
Subject: [PATCH] fix IORESOURCE_MEM_xxx usage in dm9k driver
Date: Sat, 25 Jun 2016 11:53:00 +0800	[thread overview]
Message-ID: <1466826780-23656-1-git-send-email-zzs213@126.com> (raw)

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

             reply	other threads:[~2016-06-25  3:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-25  3:53 zzs213 [this message]
2016-06-27  7:47 ` Sascha Hauer
2016-06-27  8:18   ` 张忠山
2016-06-27  8:20   ` 张忠山
2016-06-27  8:21   ` 张忠山

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=1466826780-23656-1-git-send-email-zzs213@126.com \
    --to=zzs213@126.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