diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 15741367eb3..ce6644f41b2 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -265,6 +265,30 @@ static int ide_system_bus_speed(void) return system_bus_speed; } +ide_hwif_t * ide_find_port(unsigned long base) +{ + ide_hwif_t *hwif; + int i; + + for (i = 0; i < MAX_HWIFS; i++) { + hwif = &ide_hwifs[i]; + if (hwif->io_ports[IDE_DATA_OFFSET] == base) + goto found; + } + + for (i = 0; i < MAX_HWIFS; i++) { + hwif = &ide_hwifs[i]; + if (hwif->io_ports[IDE_DATA_OFFSET] == 0) + goto found; + } + + hwif = NULL; +found: + return hwif; +} + +EXPORT_SYMBOL_GPL(ide_find_port); + static struct resource* hwif_request_region(ide_hwif_t *hwif, unsigned long addr, int num) { |