Commit 582a045d authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] fix powerbook media bay

This patch fixes a couple of bugs and compile errors in the powerbook
media bay driver.  It was getting initialized after the IDE subsystem,
whereas it needs to be initialized before so that the IDE subsystem
can see the CD-ROM drive in the bay.
parent f301496d
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ide.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -493,7 +494,7 @@ media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, ...@@ -493,7 +494,7 @@ media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base,
} while(--timeout); } while(--timeout);
printk(KERN_DEBUG "Timeount waiting IDE in bay %d\n", i); printk(KERN_DEBUG "Timeount waiting IDE in bay %d\n", i);
return -ENODEV; return -ENODEV;
} }
#endif #endif
return -ENODEV; return -ENODEV;
...@@ -567,9 +568,10 @@ media_bay_step(int i) ...@@ -567,9 +568,10 @@ media_bay_step(int i)
hw_regs_t hw; hw_regs_t hw;
pmu_suspend(); pmu_suspend();
ide_init_hwif_ports(&hw, (ide_ioreg_t) bay->cd_base, (ide_ioreg_t) 0, NULL); ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL);
hw.irq = bay->cd_irq; hw.irq = bay->cd_irq;
bay->cd_index = ide_register_hw(&hw); hw.chipset = ide_pmac;
bay->cd_index = ide_register_hw(&hw, NULL);
pmu_resume(); pmu_resume();
} }
if (bay->cd_index == -1) { if (bay->cd_index == -1) {
...@@ -834,4 +836,4 @@ media_bay_init(void) ...@@ -834,4 +836,4 @@ media_bay_init(void)
return 0; return 0;
} }
device_initcall(media_bay_init); subsys_initcall(media_bay_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment