diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-05-10 11:46:13 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-05-11 12:18:55 -0400 |
commit | c7b87f3d5037a35b5c7bb916ffc826be3fcb208d (patch) | |
tree | 57fb9d7bb21965fa0d78b26043cf459ce51a9668 /drivers/ata/pata_icside.c | |
parent | 129a84de2347002f09721cda3155ccfd19fade40 (diff) |
[ARM] ecard: add helper function for setting ecard irq ops
Rather than having every driver fiddle about setting its private
IRQ operations and data, provide a helper function to contain
this functionality in one place.
Arrange to remove the driver-private IRQ operations and data when
the device is removed from the driver, and remove the driver
private code to do this.
This fixes potential problems caused by drivers forgetting to
remove these hooks.
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.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c index dbc8ee2adcf0..d7621a39ed09 100644 --- a/drivers/ata/pata_icside.c +++ b/drivers/ata/pata_icside.c | |||
@@ -434,8 +434,8 @@ pata_icside_register_v5(struct ata_probe_ent *ae, struct expansion_card *ec) | |||
434 | 434 | ||
435 | ec->irqaddr = base + ICS_ARCIN_V5_INTRSTAT; | 435 | ec->irqaddr = base + ICS_ARCIN_V5_INTRSTAT; |
436 | ec->irqmask = 1; | 436 | ec->irqmask = 1; |
437 | ec->irq_data = state; | 437 | |
438 | ec->ops = &pata_icside_ops_arcin_v5; | 438 | ecard_setirq(ec, &pata_icside_ops_arcin_v5, state); |
439 | 439 | ||
440 | /* | 440 | /* |
441 | * Be on the safe side - disable interrupts | 441 | * Be on the safe side - disable interrupts |
@@ -480,8 +480,7 @@ pata_icside_register_v6(struct ata_probe_ent *ae, struct expansion_card *ec) | |||
480 | 480 | ||
481 | writeb(sel, ioc_base); | 481 | writeb(sel, ioc_base); |
482 | 482 | ||
483 | ec->irq_data = state; | 483 | ecard_setirq(ec, &pata_icside_ops_arcin_v6, state); |
484 | ec->ops = &pata_icside_ops_arcin_v6; | ||
485 | 484 | ||
486 | state->irq_port = easi_base; | 485 | state->irq_port = easi_base; |
487 | state->ioc_base = ioc_base; | 486 | state->ioc_base = ioc_base; |
@@ -609,8 +608,7 @@ static void pata_icside_shutdown(struct expansion_card *ec) | |||
609 | * this register via that region. | 608 | * this register via that region. |
610 | */ | 609 | */ |
611 | local_irq_save(flags); | 610 | local_irq_save(flags); |
612 | if (ec->ops) | 611 | ec->ops->irqdisable(ec, ec->irq); |
613 | ec->ops->irqdisable(ec, ec->irq); | ||
614 | local_irq_restore(flags); | 612 | local_irq_restore(flags); |
615 | 613 | ||
616 | /* | 614 | /* |
@@ -638,9 +636,6 @@ static void __devexit pata_icside_remove(struct expansion_card *ec) | |||
638 | * don't NULL out the drvdata - devres/libata wants it | 636 | * don't NULL out the drvdata - devres/libata wants it |
639 | * to free the ata_host structure. | 637 | * to free the ata_host structure. |
640 | */ | 638 | */ |
641 | ec->ops = NULL; | ||
642 | ec->irq_data = NULL; | ||
643 | |||
644 | if (state->dma != NO_DMA) | 639 | if (state->dma != NO_DMA) |
645 | free_dma(state->dma); | 640 | free_dma(state->dma); |
646 | if (state->ioc_base) | 641 | if (state->ioc_base) |