mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <shc_work@mail.ru>
To: barebox@lists.infradead.org
Subject: [PATCH] Allow use platform_ide driver without ALT-registers
Date: Wed, 18 Apr 2012 22:25:10 +0400	[thread overview]
Message-ID: <1334773510-13806-1-git-send-email-shc_work@mail.ru> (raw)


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/ata/intf_platform_ide.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/intf_platform_ide.c b/drivers/ata/intf_platform_ide.c
index 1955a9c..af20e05 100644
--- a/drivers/ata/intf_platform_ide.c
+++ b/drivers/ata/intf_platform_ide.c
@@ -64,10 +64,16 @@ static void platform_ide_setup_port(void *reg_base, void *alt_base,
 	ioaddr->status_addr = reg_base + (IDE_REG_STATUS << shift);
 	ioaddr->command_addr = reg_base + (IDE_REG_CMD << shift);
 
-	ioaddr->altstatus_addr = alt_base + (IDE_REG_ALT_STATUS << shift);
-	ioaddr->ctl_addr = alt_base + (IDE_REG_DEV_CTL << shift);
-
-	ioaddr->alt_dev_addr = alt_base + (IDE_REG_DRV_ADDR << shift);
+	if (alt_base) {
+		ioaddr->altstatus_addr = alt_base + (IDE_REG_ALT_STATUS << shift);
+		ioaddr->ctl_addr = alt_base + (IDE_REG_DEV_CTL << shift);
+
+		ioaddr->alt_dev_addr = alt_base + (IDE_REG_DRV_ADDR << shift);
+	} else {
+		ioaddr->altstatus_addr = ioaddr->status_addr;
+		ioaddr->ctl_addr = ioaddr->status_addr;
+		/* ioaddr->alt_dev_addr not used in driver */
+	}
 }
 
 static int platform_ide_probe(struct device_d *dev)
-- 
1.7.3.4


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

             reply	other threads:[~2012-04-18 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 18:25 Alexander Shiyan [this message]
2012-04-18 18:43 ` 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=1334773510-13806-1-git-send-email-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --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