aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-07 09:37:06 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-07 09:37:06 -0400
commitdff8817b78e6e6a4913f2caf7637d62dcc49a03c (patch)
tree2a9864fea9bb685813bdf5745ec7ab51f81c6aa7
parent49d8078ad1c3dca5b11ce18391bf6bd9af9acdf5 (diff)
icside: remove superfluous ->maskproc method
[inspired by pata_icside] Enabling/disabling of card IRQs is handled fine by IRQ and IDE subsystems so there is no need for custom ->maskproc method. Moreover icside_maskproc() would enable IRQ only if it was already enabled [because of 'if (state->enabled && !mask)' check]. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/icside.c64
1 files changed, 4 insertions, 60 deletions
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index c5269fa1f733..5af3d0ffaf0a 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -65,8 +65,6 @@ static struct cardinfo icside_cardinfo_v6_2 = {
65}; 65};
66 66
67struct icside_state { 67struct icside_state {
68 unsigned int channel;
69 unsigned int enabled;
70 void __iomem *irq_port; 68 void __iomem *irq_port;
71 void __iomem *ioc_base; 69 void __iomem *ioc_base;
72 unsigned int sel; 70 unsigned int sel;
@@ -116,18 +114,11 @@ static void icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr)
116 struct icside_state *state = ec->irq_data; 114 struct icside_state *state = ec->irq_data;
117 void __iomem *base = state->irq_port; 115 void __iomem *base = state->irq_port;
118 116
119 state->enabled = 1; 117 writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
118 readb(base + ICS_ARCIN_V6_INTROFFSET_2);
120 119
121 switch (state->channel) { 120 writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
122 case 0: 121 readb(base + ICS_ARCIN_V6_INTROFFSET_1);
123 writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
124 readb(base + ICS_ARCIN_V6_INTROFFSET_2);
125 break;
126 case 1:
127 writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
128 readb(base + ICS_ARCIN_V6_INTROFFSET_1);
129 break;
130 }
131} 122}
132 123
133/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr) 124/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
@@ -137,8 +128,6 @@ static void icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
137{ 128{
138 struct icside_state *state = ec->irq_data; 129 struct icside_state *state = ec->irq_data;
139 130
140 state->enabled = 0;
141
142 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1); 131 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
143 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2); 132 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
144} 133}
@@ -160,44 +149,6 @@ static const expansioncard_ops_t icside_ops_arcin_v6 = {
160 .irqpending = icside_irqpending_arcin_v6, 149 .irqpending = icside_irqpending_arcin_v6,
161}; 150};
162 151
163/*
164 * Handle routing of interrupts. This is called before
165 * we write the command to the drive.
166 */
167static void icside_maskproc(ide_drive_t *drive, int mask)
168{
169 ide_hwif_t *hwif = drive->hwif;
170 struct expansion_card *ec = ECARD_DEV(hwif->dev);
171 struct icside_state *state = ecard_get_drvdata(ec);
172 unsigned long flags;
173
174 local_irq_save(flags);
175
176 state->channel = hwif->channel;
177
178 if (state->enabled && !mask) {
179 switch (hwif->channel) {
180 case 0:
181 writeb(0, state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
182 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
183 break;
184 case 1:
185 writeb(0, state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
186 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
187 break;
188 }
189 } else {
190 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
191 readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
192 }
193
194 local_irq_restore(flags);
195}
196
197static const struct ide_port_ops icside_v6_no_dma_port_ops = {
198 .maskproc = icside_maskproc,
199};
200
201#ifdef CONFIG_BLK_DEV_IDEDMA_ICS 152#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
202/* 153/*
203 * SG-DMA support. 154 * SG-DMA support.
@@ -275,7 +226,6 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
275 226
276static const struct ide_port_ops icside_v6_port_ops = { 227static const struct ide_port_ops icside_v6_port_ops = {
277 .set_dma_mode = icside_set_dma_mode, 228 .set_dma_mode = icside_set_dma_mode,
278 .maskproc = icside_maskproc,
279}; 229};
280 230
281static void icside_dma_host_set(ide_drive_t *drive, int on) 231static void icside_dma_host_set(ide_drive_t *drive, int on)
@@ -320,11 +270,6 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
320 BUG_ON(dma_channel_active(ec->dma)); 270 BUG_ON(dma_channel_active(ec->dma));
321 271
322 /* 272 /*
323 * Ensure that we have the right interrupt routed.
324 */
325 icside_maskproc(drive, 0);
326
327 /*
328 * Route the DMA signals to the correct interface. 273 * Route the DMA signals to the correct interface.
329 */ 274 */
330 writeb(state->sel | hwif->channel, state->ioc_base); 275 writeb(state->sel | hwif->channel, state->ioc_base);
@@ -452,7 +397,6 @@ err_free:
452 397
453static const struct ide_port_info icside_v6_port_info __initdata = { 398static const struct ide_port_info icside_v6_port_info __initdata = {
454 .init_dma = icside_dma_off_init, 399 .init_dma = icside_dma_off_init,
455 .port_ops = &icside_v6_no_dma_port_ops,
456 .dma_ops = &icside_v6_dma_ops, 400 .dma_ops = &icside_v6_dma_ops,
457 .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO, 401 .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
458 .mwdma_mask = ATA_MWDMA2, 402 .mwdma_mask = ATA_MWDMA2,