diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:31 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:31 -0400 |
commit | baa8f3e94bc7a7ba3650d80b67d54c3e08365dee (patch) | |
tree | caabf63904cd62f758535e16dcc4676ba3ae5095 /drivers/ide/arm/icside.c | |
parent | 8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d (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/arm/icside.c')
-rw-r--r-- | drivers/ide/arm/icside.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 6298932c0589..fda3f870d7cd 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -438,35 +438,13 @@ static void icside_dma_init(ide_hwif_t *hwif) | |||
438 | #define icside_dma_init(hwif) (0) | 438 | #define icside_dma_init(hwif) (0) |
439 | #endif | 439 | #endif |
440 | 440 | ||
441 | static ide_hwif_t *icside_find_hwif(unsigned long dataport) | ||
442 | { | ||
443 | ide_hwif_t *hwif; | ||
444 | int index; | ||
445 | |||
446 | for (index = 0; index < MAX_HWIFS; ++index) { | ||
447 | hwif = &ide_hwifs[index]; | ||
448 | if (hwif->io_ports[IDE_DATA_OFFSET] == dataport) | ||
449 | goto found; | ||
450 | } | ||
451 | |||
452 | for (index = 0; index < MAX_HWIFS; ++index) { | ||
453 | hwif = &ide_hwifs[index]; | ||
454 | if (!hwif->io_ports[IDE_DATA_OFFSET]) | ||
455 | goto found; | ||
456 | } | ||
457 | |||
458 | hwif = NULL; | ||
459 | found: | ||
460 | return hwif; | ||
461 | } | ||
462 | |||
463 | static ide_hwif_t * | 441 | static ide_hwif_t * |
464 | icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) | 442 | icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) |
465 | { | 443 | { |
466 | unsigned long port = (unsigned long)base + info->dataoffset; | 444 | unsigned long port = (unsigned long)base + info->dataoffset; |
467 | ide_hwif_t *hwif; | 445 | ide_hwif_t *hwif; |
468 | 446 | ||
469 | hwif = icside_find_hwif(port); | 447 | hwif = ide_find_port(port); |
470 | if (hwif) { | 448 | if (hwif) { |
471 | int i; | 449 | int i; |
472 | 450 | ||