diff options
-rw-r--r-- | drivers/ide/ide.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index fa16bc30bbc9..c2b791224097 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -667,7 +667,6 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *), | |||
667 | 667 | ||
668 | do { | 668 | do { |
669 | hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]); | 669 | hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]); |
670 | index = hwif->index; | ||
671 | if (hwif) | 670 | if (hwif) |
672 | goto found; | 671 | goto found; |
673 | for (index = 0; index < MAX_HWIFS; index++) | 672 | for (index = 0; index < MAX_HWIFS; index++) |
@@ -675,6 +674,7 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *), | |||
675 | } while (retry--); | 674 | } while (retry--); |
676 | return -1; | 675 | return -1; |
677 | found: | 676 | found: |
677 | index = hwif->index; | ||
678 | if (hwif->present) | 678 | if (hwif->present) |
679 | ide_unregister(index, 0, 1); | 679 | ide_unregister(index, 0, 1); |
680 | else if (!hwif->hold) | 680 | else if (!hwif->hold) |