aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_icside.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-05-10 13:40:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-05-11 12:19:02 -0400
commit10bdaaa0fad620145cf10e2b573266b2d80b44de (patch)
tree8d3200f5041ab0fdc72e9245ef780310b27a18d8 /drivers/ata/pata_icside.c
parentc7b87f3d5037a35b5c7bb916ffc826be3fcb208d (diff)
[ARM] ecard: add ecardm_iomap() / ecardm_iounmap()
Add devres ecardm_iomap() and ecardm_iounmap() for Acorn expansion cards. Convert all expansion card drivers to use them. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/ata/pata_icside.c')
-rw-r--r--drivers/ata/pata_icside.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index d7621a39ed09..d323e75b05d5 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -425,8 +425,7 @@ pata_icside_register_v5(struct ata_probe_ent *ae, struct expansion_card *ec)
425 struct pata_icside_state *state = ae->private_data; 425 struct pata_icside_state *state = ae->private_data;
426 void __iomem *base; 426 void __iomem *base;
427 427
428 base = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC), 428 base = ecardm_iomap(info->ec, ECARD_RES_MEMC, 0, 0);
429 ecard_resource_len(ec, ECARD_RES_MEMC));
430 if (!base) 429 if (!base)
431 return -ENOMEM; 430 return -ENOMEM;
432 431
@@ -453,24 +452,17 @@ pata_icside_register_v6(struct ata_probe_ent *ae, struct expansion_card *ec)
453 struct pata_icside_state *state = ae->private_data; 452 struct pata_icside_state *state = ae->private_data;
454 void __iomem *ioc_base, *easi_base; 453 void __iomem *ioc_base, *easi_base;
455 unsigned int sel = 0; 454 unsigned int sel = 0;
456 int ret;
457 455
458 ioc_base = ioremap(ecard_resource_start(ec, ECARD_RES_IOCFAST), 456 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
459 ecard_resource_len(ec, ECARD_RES_IOCFAST)); 457 if (!ioc_base)
460 if (!ioc_base) { 458 return -ENOMEM;
461 ret = -ENOMEM;
462 goto out;
463 }
464 459
465 easi_base = ioc_base; 460 easi_base = ioc_base;
466 461
467 if (ecard_resource_flags(ec, ECARD_RES_EASI)) { 462 if (ecard_resource_flags(ec, ECARD_RES_EASI)) {
468 easi_base = ioremap(ecard_resource_start(ec, ECARD_RES_EASI), 463 easi_base = ecardm_iomap(ec, ECARD_RES_EASI, 0, 0);
469 ecard_resource_len(ec, ECARD_RES_EASI)); 464 if (!easi_base)
470 if (!easi_base) { 465 return -ENOMEM;
471 ret = -ENOMEM;
472 goto unmap_slot;
473 }
474 466
475 /* 467 /*
476 * Enable access to the EASI region. 468 * Enable access to the EASI region.
@@ -507,10 +499,6 @@ pata_icside_register_v6(struct ata_probe_ent *ae, struct expansion_card *ec)
507 499
508 return icside_dma_init(ae, ec); 500 return icside_dma_init(ae, ec);
509 501
510 unmap_slot:
511 iounmap(ioc_base);
512 out:
513 return ret;
514} 502}
515 503
516static int __devinit 504static int __devinit
@@ -534,8 +522,7 @@ pata_icside_probe(struct expansion_card *ec, const struct ecard_id *id)
534 state->type = ICS_TYPE_NOTYPE; 522 state->type = ICS_TYPE_NOTYPE;
535 state->dma = NO_DMA; 523 state->dma = NO_DMA;
536 524
537 idmem = ioremap(ecard_resource_start(ec, ECARD_RES_IOCFAST), 525 idmem = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
538 ecard_resource_len(ec, ECARD_RES_IOCFAST));
539 if (idmem) { 526 if (idmem) {
540 unsigned int type; 527 unsigned int type;
541 528
@@ -543,7 +530,7 @@ pata_icside_probe(struct expansion_card *ec, const struct ecard_id *id)
543 type |= (readb(idmem + ICS_IDENT_OFFSET + 4) & 1) << 1; 530 type |= (readb(idmem + ICS_IDENT_OFFSET + 4) & 1) << 1;
544 type |= (readb(idmem + ICS_IDENT_OFFSET + 8) & 1) << 2; 531 type |= (readb(idmem + ICS_IDENT_OFFSET + 8) & 1) << 2;
545 type |= (readb(idmem + ICS_IDENT_OFFSET + 12) & 1) << 3; 532 type |= (readb(idmem + ICS_IDENT_OFFSET + 12) & 1) << 3;
546 iounmap(idmem); 533 ecardm_iounmap(ec, idmem);
547 534
548 state->type = type; 535 state->type = type;
549 } 536 }
@@ -638,10 +625,6 @@ static void __devexit pata_icside_remove(struct expansion_card *ec)
638 */ 625 */
639 if (state->dma != NO_DMA) 626 if (state->dma != NO_DMA)
640 free_dma(state->dma); 627 free_dma(state->dma);
641 if (state->ioc_base)
642 iounmap(state->ioc_base);
643 if (state->ioc_base != state->irq_port)
644 iounmap(state->irq_port);
645 628
646 kfree(state); 629 kfree(state);
647 ecard_release_resources(ec); 630 ecard_release_resources(ec);