summaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_icside.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-05-10 16:46:13 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-05-11 17:18:55 +0100
commitc7b87f3d5037a35b5c7bb916ffc826be3fcb208d (patch)
tree57fb9d7bb21965fa0d78b26043cf459ce51a9668 /drivers/ata/pata_icside.c
parent129a84de2347002f09721cda3155ccfd19fade40 (diff)
downloadtalos-op-linux-c7b87f3d5037a35b5c7bb916ffc826be3fcb208d.tar.gz
talos-op-linux-c7b87f3d5037a35b5c7bb916ffc826be3fcb208d.zip
[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.c13
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)
ec->irqaddr = base + ICS_ARCIN_V5_INTRSTAT;
ec->irqmask = 1;
- ec->irq_data = state;
- ec->ops = &pata_icside_ops_arcin_v5;
+
+ ecard_setirq(ec, &pata_icside_ops_arcin_v5, state);
/*
* Be on the safe side - disable interrupts
@@ -480,8 +480,7 @@ pata_icside_register_v6(struct ata_probe_ent *ae, struct expansion_card *ec)
writeb(sel, ioc_base);
- ec->irq_data = state;
- ec->ops = &pata_icside_ops_arcin_v6;
+ ecard_setirq(ec, &pata_icside_ops_arcin_v6, state);
state->irq_port = easi_base;
state->ioc_base = ioc_base;
@@ -609,8 +608,7 @@ static void pata_icside_shutdown(struct expansion_card *ec)
* this register via that region.
*/
local_irq_save(flags);
- if (ec->ops)
- ec->ops->irqdisable(ec, ec->irq);
+ ec->ops->irqdisable(ec, ec->irq);
local_irq_restore(flags);
/*
@@ -638,9 +636,6 @@ static void __devexit pata_icside_remove(struct expansion_card *ec)
* don't NULL out the drvdata - devres/libata wants it
* to free the ata_host structure.
*/
- ec->ops = NULL;
- ec->irq_data = NULL;
-
if (state->dma != NO_DMA)
free_dma(state->dma);
if (state->ioc_base)
OpenPOWER on IntegriCloud