aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/sa.c
diff options
context:
space:
mode:
authorMark Haverkamp <markh@osdl.org>2006-09-19 12:00:02 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-09-23 21:09:42 -0400
commit76a7f8fdc0c2381ae1ba55ef71837712223ecb3c (patch)
treeb6672be9f0c94d36841e56e6cf8a8636028268c5 /drivers/scsi/aacraid/sa.c
parent653ba58d55feb708c6f97e6f3e84901b3a03c9c0 (diff)
[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 'drivers/scsi/aacraid/sa.c')
-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)
281} 281}
282 282
283/** 283/**
284 * aac_sa_ioremap
285 * @size: mapping resize request
286 *
287 */
288static int aac_sa_ioremap(struct aac_dev * dev, u32 size)
289{
290 if (!size) {
291 iounmap(dev->regs.sa);
292 return 0;
293 }
294 dev->base = dev->regs.sa = ioremap(dev->scsi_host_ptr->base, size);
295 return (dev->base == NULL) ? -1 : 0;
296}
297
298/**
284 * aac_sa_init - initialize an ARM based AAC card 299 * aac_sa_init - initialize an ARM based AAC card
285 * @dev: device to configure 300 * @dev: device to configure
286 * 301 *
@@ -299,6 +314,11 @@ int aac_sa_init(struct aac_dev *dev)
299 instance = dev->id; 314 instance = dev->id;
300 name = dev->name; 315 name = dev->name;
301 316
317 if (aac_sa_ioremap(dev, dev->base_size)) {
318 printk(KERN_WARNING "%s: unable to map adapter.\n", name);
319 goto error_iounmap;
320 }
321
302 /* 322 /*
303 * Check to see if the board failed any self tests. 323 * Check to see if the board failed any self tests.
304 */ 324 */
@@ -341,6 +361,7 @@ int aac_sa_init(struct aac_dev *dev)
341 dev->a_ops.adapter_notify = aac_sa_notify_adapter; 361 dev->a_ops.adapter_notify = aac_sa_notify_adapter;
342 dev->a_ops.adapter_sync_cmd = sa_sync_cmd; 362 dev->a_ops.adapter_sync_cmd = sa_sync_cmd;
343 dev->a_ops.adapter_check_health = aac_sa_check_health; 363 dev->a_ops.adapter_check_health = aac_sa_check_health;
364 dev->a_ops.adapter_ioremap = aac_sa_ioremap;
344 365
345 /* 366 /*
346 * First clear out all interrupts. Then enable the one's that 367 * First clear out all interrupts. Then enable the one's that