mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] net: dm9k: Fix resource sizes in add_dm9000_device
Date: Wed, 18 Dec 2013 16:45:14 +0100	[thread overview]
Message-ID: <1387381515-15476-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1387381515-15476-1-git-send-email-s.hauer@pengutronix.de>

The dm9000 needs a resource for an index register and one for
the data register. Both should have a size of the access width,
and not two times the access width. The current code is probably
a leftover when the dm9000 had only one resource.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/base/resource.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/resource.c b/drivers/base/resource.c
index 2985c78..095b8d2 100644
--- a/drivers/base/resource.c
+++ b/drivers/base/resource.c
@@ -76,13 +76,13 @@ struct device_d *add_dm9000_device(int id, resource_size_t base,
 
 	switch (flags) {
 	case IORESOURCE_MEM_32BIT:
-		size = 8;
+		size = 4;
 		break;
 	case IORESOURCE_MEM_16BIT:
-		size = 4;
+		size = 2;
 		break;
 	case IORESOURCE_MEM_8BIT:
-		size = 2;
+		size = 1;
 		break;
 	default:
 		printf("dm9000: memory width flag missing\n");
-- 
1.8.5.1


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

  reply	other threads:[~2013-12-18 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 15:45 dm9000 patches Sascha Hauer
2013-12-18 15:45 ` Sascha Hauer [this message]
2013-12-18 15:45 ` [PATCH 2/2] net: dm9k: bail out when resources can't be claimed Sascha Hauer

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=1387381515-15476-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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