aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:31 -0400
commitbaa8f3e94bc7a7ba3650d80b67d54c3e08365dee (patch)
treecaabf63904cd62f758535e16dcc4676ba3ae5095 /drivers/ide/ide.c
parent8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d (diff)
ide: add ide_find_port() helper
* Add ide_find_port() helper. * Convert icside, rapide and ide_platform host drivers to use it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 15741367eb35..ce6644f41b21 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -265,6 +265,30 @@ static int ide_system_bus_speed(void)
265 return system_bus_speed; 265 return system_bus_speed;
266} 266}
267 267
268ide_hwif_t * ide_find_port(unsigned long base)
269{
270 ide_hwif_t *hwif;
271 int i;
272
273 for (i = 0; i < MAX_HWIFS; i++) {
274 hwif = &ide_hwifs[i];
275 if (hwif->io_ports[IDE_DATA_OFFSET] == base)
276 goto found;
277 }
278
279 for (i = 0; i < MAX_HWIFS; i++) {
280 hwif = &ide_hwifs[i];
281 if (hwif->io_ports[IDE_DATA_OFFSET] == 0)
282 goto found;
283 }
284
285 hwif = NULL;
286found:
287 return hwif;
288}
289
290EXPORT_SYMBOL_GPL(ide_find_port);
291
268static struct resource* hwif_request_region(ide_hwif_t *hwif, 292static struct resource* hwif_request_region(ide_hwif_t *hwif,
269 unsigned long addr, int num) 293 unsigned long addr, int num)
270{ 294{