From 2dde7861afa23cd59db83515cb0b810b92b220aa Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 18 Apr 2008 00:46:23 +0200 Subject: ide: rework PowerMac media-bay support (take 2) Rework PowerMac media-bay support in such way that instead of un/registering the IDE interface we un/register IDE devices: * Add ide_port_scan() helper for probing+registerering devices on a port. * Rename ide_port_unregister_devices() to __ide_port_unregister_devices(). * Add ide_port_unregister_devices() helper for unregistering devices on a port. * Add 'ide_hwif_t *cd_port' to 'struct media_bay_info', pass 'hwif' instead of hwif->index to media_bay_set_ide_infos() and use it to setup 'cd_port'. * Use ide_port_unregister_devices() instead of ide_unregister() and ide_port_scan() instead of ide_register_hw() in media_bay_step(). * Unexport ide_register_hw() and make it static. v2: * Fix build by adding include to . (Reported by Michael/Kamalesh/Andrew). Cc: Kamalesh Babulal Cc: Michael Ellerman Cc: Andrew Morton Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-powerpc/mediabay.h | 6 +++++- include/linux/ide.h | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/mediabay.h b/include/asm-powerpc/mediabay.h index de83fe19630..df111c362a7 100644 --- a/include/asm-powerpc/mediabay.h +++ b/include/asm-powerpc/mediabay.h @@ -22,10 +22,14 @@ int check_media_bay(struct device_node *which_bay, int what); /* Number of bays in the machine or 0 */ extern int media_bay_count; +#ifdef CONFIG_BLK_DEV_IDE_PMAC +#include + int check_media_bay_by_base(unsigned long base, int what); /* called by IDE PMAC host driver to register IDE controller for media bay */ int media_bay_set_ide_infos(struct device_node *which_bay, unsigned long base, - int irq, int index); + int irq, ide_hwif_t *hwif); +#endif #endif /* __KERNEL__ */ #endif /* _PPC_MEDIABAY_H */ diff --git a/include/linux/ide.h b/include/linux/ide.h index f9449ecd79d..9aaad7e7059 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -189,10 +189,6 @@ struct hwif_s * ide_find_port(unsigned long); void ide_init_port_data(struct hwif_s *, unsigned int); void ide_init_port_hw(struct hwif_s *, hw_regs_t *); -struct ide_drive_s; -int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), - struct hwif_s **); - static inline void ide_std_init_ports(hw_regs_t *hw, unsigned long io_addr, unsigned long ctl_addr) @@ -1204,6 +1200,8 @@ void ide_undecoded_slave(ide_drive_t *); int ide_device_add_all(u8 *idx, const struct ide_port_info *); int ide_device_add(u8 idx[4], const struct ide_port_info *); +void ide_port_unregister_devices(ide_hwif_t *); +void ide_port_scan(ide_hwif_t *); static inline void *ide_get_hwifdata (ide_hwif_t * hwif) { -- cgit v1.2.3