aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/mediabay.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index bd8a1d14b45d..82add26cc665 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -79,6 +79,7 @@ struct media_bay_info {
79 int sleeping; 79 int sleeping;
80 struct semaphore lock; 80 struct semaphore lock;
81#ifdef CONFIG_BLK_DEV_IDE_PMAC 81#ifdef CONFIG_BLK_DEV_IDE_PMAC
82 ide_hwif_t *cd_port;
82 void __iomem *cd_base; 83 void __iomem *cd_base;
83 int cd_irq; 84 int cd_irq;
84 int cd_retry; 85 int cd_retry;
@@ -448,7 +449,7 @@ int check_media_bay_by_base(unsigned long base, int what)
448} 449}
449 450
450int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, 451int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base,
451 int irq, int index) 452 int irq, ide_hwif_t *hwif)
452{ 453{
453 int i; 454 int i;
454 455
@@ -456,10 +457,11 @@ int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base,
456 struct media_bay_info* bay = &media_bays[i]; 457 struct media_bay_info* bay = &media_bays[i];
457 458
458 if (bay->mdev && which_bay == bay->mdev->ofdev.node) { 459 if (bay->mdev && which_bay == bay->mdev->ofdev.node) {
459 int timeout = 5000; 460 int timeout = 5000, index = hwif->index;
460 461
461 down(&bay->lock); 462 down(&bay->lock);
462 463
464 bay->cd_port = hwif;
463 bay->cd_base = (void __iomem *) base; 465 bay->cd_base = (void __iomem *) base;
464 bay->cd_irq = irq; 466 bay->cd_irq = irq;
465 467
@@ -551,15 +553,10 @@ static void media_bay_step(int i)
551 bay->timer = 0; 553 bay->timer = 0;
552 bay->state = mb_up; 554 bay->state = mb_up;
553 if (bay->cd_index < 0) { 555 if (bay->cd_index < 0) {
554 hw_regs_t hw;
555
556 printk("mediabay %d, registering IDE...\n", i); 556 printk("mediabay %d, registering IDE...\n", i);
557 pmu_suspend(); 557 pmu_suspend();
558 ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL); 558 ide_port_scan(bay->cd_port);
559 hw.irq = bay->cd_irq; 559 bay->cd_index = bay->cd_port->index;
560 hw.chipset = ide_pmac;
561 bay->cd_index =
562 ide_register_hw(&hw, NULL, NULL);
563 pmu_resume(); 560 pmu_resume();
564 } 561 }
565 if (bay->cd_index == -1) { 562 if (bay->cd_index == -1) {
@@ -589,7 +586,7 @@ static void media_bay_step(int i)
589 if (bay->cd_index >= 0) { 586 if (bay->cd_index >= 0) {
590 printk(KERN_DEBUG "Unregistering mb %d ide, index:%d\n", i, 587 printk(KERN_DEBUG "Unregistering mb %d ide, index:%d\n", i,
591 bay->cd_index); 588 bay->cd_index);
592 ide_unregister(bay->cd_index, 1, 1); 589 ide_port_unregister_devices(bay->cd_port);
593 bay->cd_index = -1; 590 bay->cd_index = -1;
594 } 591 }
595 if (bay->cd_retry) { 592 if (bay->cd_retry) {