aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:40 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:40 -0400
commit26839f09ca2d0f4239e546cd912bc9f4694f3c5e (patch)
tree56ffa2455e75b0f7b998f75271738143b8738841 /drivers/ide
parentdccdf527379dc2fe8a4efc5c75601d1d4035a750 (diff)
icside: don't use hwif->hwif_data
* Move ecard_set_drvdata() from icside_probe() to icside_register_v{5,6}(), then use state->ioc_base instead of hwif->hwif_data in icside_maskproc() and icside_dma_test_irq(). While at it: * Add sel field to struct icside_state, then use state->{sel,ioc_base} instead of ->{select,config}_data in icside_dma_setup(). There should be no functional changes caused by this patch. Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/arm/icside.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 061456914ca3..743958044278 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -68,6 +68,7 @@ struct icside_state {
68 unsigned int enabled; 68 unsigned int enabled;
69 void __iomem *irq_port; 69 void __iomem *irq_port;
70 void __iomem *ioc_base; 70 void __iomem *ioc_base;
71 unsigned int sel;
71 unsigned int type; 72 unsigned int type;
72 ide_hwif_t *hwif[2]; 73 ide_hwif_t *hwif[2];
73}; 74};
@@ -165,7 +166,8 @@ static const expansioncard_ops_t icside_ops_arcin_v6 = {
165static void icside_maskproc(ide_drive_t *drive, int mask) 166static void icside_maskproc(ide_drive_t *drive, int mask)
166{ 167{
167 ide_hwif_t *hwif = HWIF(drive); 168 ide_hwif_t *hwif = HWIF(drive);
168 struct icside_state *state = hwif->hwif_data; 169 struct expansion_card *ec = ECARD_DEV(hwif->dev);
170 struct icside_state *state = ecard_get_drvdata(ec);
169 unsigned long flags; 171 unsigned long flags;
170 172
171 local_irq_save(flags); 173 local_irq_save(flags);
@@ -308,6 +310,7 @@ static int icside_dma_setup(ide_drive_t *drive)
308{ 310{
309 ide_hwif_t *hwif = HWIF(drive); 311 ide_hwif_t *hwif = HWIF(drive);
310 struct expansion_card *ec = ECARD_DEV(hwif->dev); 312 struct expansion_card *ec = ECARD_DEV(hwif->dev);
313 struct icside_state *state = ecard_get_drvdata(ec);
311 struct request *rq = hwif->hwgroup->rq; 314 struct request *rq = hwif->hwgroup->rq;
312 unsigned int dma_mode; 315 unsigned int dma_mode;
313 316
@@ -331,7 +334,7 @@ static int icside_dma_setup(ide_drive_t *drive)
331 /* 334 /*
332 * Route the DMA signals to the correct interface. 335 * Route the DMA signals to the correct interface.
333 */ 336 */
334 writeb(hwif->select_data, hwif->config_data); 337 writeb(state->sel | hwif->channel, state->ioc_base);
335 338
336 /* 339 /*
337 * Select the correct timing for this drive. 340 * Select the correct timing for this drive.
@@ -359,7 +362,8 @@ static void icside_dma_exec_cmd(ide_drive_t *drive, u8 cmd)
359static int icside_dma_test_irq(ide_drive_t *drive) 362static int icside_dma_test_irq(ide_drive_t *drive)
360{ 363{
361 ide_hwif_t *hwif = HWIF(drive); 364 ide_hwif_t *hwif = HWIF(drive);
362 struct icside_state *state = hwif->hwif_data; 365 struct expansion_card *ec = ECARD_DEV(hwif->dev);
366 struct icside_state *state = ecard_get_drvdata(ec);
363 367
364 return readb(state->irq_port + 368 return readb(state->irq_port +
365 (hwif->channel ? 369 (hwif->channel ?
@@ -472,6 +476,8 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
472 476
473 state->hwif[0] = hwif; 477 state->hwif[0] = hwif;
474 478
479 ecard_set_drvdata(ec, state);
480
475 idx[0] = hwif->index; 481 idx[0] = hwif->index;
476 482
477 ide_device_add(idx, NULL); 483 ide_device_add(idx, NULL);
@@ -525,6 +531,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
525 531
526 state->irq_port = easi_base; 532 state->irq_port = easi_base;
527 state->ioc_base = ioc_base; 533 state->ioc_base = ioc_base;
534 state->sel = sel;
528 535
529 /* 536 /*
530 * Be on the safe side - disable interrupts 537 * Be on the safe side - disable interrupts
@@ -545,13 +552,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
545 state->hwif[0] = hwif; 552 state->hwif[0] = hwif;
546 state->hwif[1] = mate; 553 state->hwif[1] = mate;
547 554
548 hwif->hwif_data = state; 555 ecard_set_drvdata(ec, state);
549 hwif->config_data = (unsigned long)ioc_base;
550 hwif->select_data = sel;
551
552 mate->hwif_data = state;
553 mate->config_data = (unsigned long)ioc_base;
554 mate->select_data = sel | 1;
555 556
556 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { 557 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
557 d.init_dma = icside_dma_init; 558 d.init_dma = icside_dma_init;
@@ -627,10 +628,8 @@ icside_probe(struct expansion_card *ec, const struct ecard_id *id)
627 break; 628 break;
628 } 629 }
629 630
630 if (ret == 0) { 631 if (ret == 0)
631 ecard_set_drvdata(ec, state);
632 goto out; 632 goto out;
633 }
634 633
635 kfree(state); 634 kfree(state);
636 release: 635 release: