ide: fix buggy code in ide_register_hw()

Relocating the index to come after finding the hwif pointer.

Signed-off-by: Peter Teoh <htmldeveloper@gmail.com>
Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by Peter Teoh and committed by Bartlomiej Zolnierkiewicz 0c6025d4 ef4298d0

+1 -1
+1 -1
drivers/ide/ide.c
··· 667 668 do { 669 hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]); 670 - index = hwif->index; 671 if (hwif) 672 goto found; 673 for (index = 0; index < MAX_HWIFS; index++) ··· 674 } while (retry--); 675 return -1; 676 found: 677 if (hwif->present) 678 ide_unregister(index, 0, 1); 679 else if (!hwif->hold)
··· 667 668 do { 669 hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]); 670 if (hwif) 671 goto found; 672 for (index = 0; index < MAX_HWIFS; index++) ··· 675 } while (retry--); 676 return -1; 677 found: 678 + index = hwif->index; 679 if (hwif->present) 680 ide_unregister(index, 0, 1); 681 else if (!hwif->hold)