summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/sa.c
diff options
context:
space:
mode:
authorMark Haverkamp <markh@osdl.org>2006-09-19 18:00:02 +0200
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-09-24 03:09:42 +0200
commit76a7f8fdc0c2381ae1ba55ef71837712223ecb3c (patch)
treeb6672be9f0c94d36841e56e6cf8a8636028268c5 /drivers/scsi/aacraid/sa.c
parent[SCSI] aacraid: expose physical devices (diff)
downloadlinux-76a7f8fdc0c2381ae1ba55ef71837712223ecb3c.tar.xz
linux-76a7f8fdc0c2381ae1ba55ef71837712223ecb3c.zip
[SCSI] aacraid: merge rx and rkt code
Received from Mark Salyzyn: The only real difference between the rkt and rx platform modules is the offset of the message registers. This patch recognizes this similarity and simplifies the driver to reduce it's code footprint and to improve maintainability by reducing the code duplication. Visibly, the 'rkt.c' portion of this patch looks more complicated than it really is. View it as retaining the rkt-only specifics of the interface. Signed-off-by: Mark Haverkamp <markh@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/aacraid/sa.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index cd586cc8f9be..f906ead239dd 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -281,6 +281,21 @@ static int aac_sa_check_health(struct aac_dev *dev)
}
/**
+ * aac_sa_ioremap
+ * @size: mapping resize request
+ *
+ */
+static int aac_sa_ioremap(struct aac_dev * dev, u32 size)
+{
+ if (!size) {
+ iounmap(dev->regs.sa);
+ return 0;
+ }
+ dev->base = dev->regs.sa = ioremap(dev->scsi_host_ptr->base, size);
+ return (dev->base == NULL) ? -1 : 0;
+}
+
+/**
* aac_sa_init - initialize an ARM based AAC card
* @dev: device to configure
*
@@ -299,6 +314,11 @@ int aac_sa_init(struct aac_dev *dev)
instance = dev->id;
name = dev->name;
+ if (aac_sa_ioremap(dev, dev->base_size)) {
+ printk(KERN_WARNING "%s: unable to map adapter.\n", name);
+ goto error_iounmap;
+ }
+
/*
* Check to see if the board failed any self tests.
*/
@@ -341,6 +361,7 @@ int aac_sa_init(struct aac_dev *dev)
dev->a_ops.adapter_notify = aac_sa_notify_adapter;
dev->a_ops.adapter_sync_cmd = sa_sync_cmd;
dev->a_ops.adapter_check_health = aac_sa_check_health;
+ dev->a_ops.adapter_ioremap = aac_sa_ioremap;
/*
* First clear out all interrupts. Then enable the one's that