palm_bk3710: port initialization/probing bugfix
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)
Probe port _after_ it is fully initialized.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/arm/palm_bk3710.c

index 0ce95c1ba7e1dd7356d85294ec3ff3acab227d18..8e40bdbc3970e4cb46e8d66052d99869d12cf07b 100644 (file)
@@ -370,13 +370,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        ide_init_port_hw(hwif, &hw);
        hwif->quirkproc = NULL;
 
-       idx[0] = i;
-
-       ide_device_add(idx, NULL);
-
-       if (!hwif->present)
-               goto out;
-
        hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
        hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
        hwif->mmio = 1;
@@ -390,6 +383,13 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 
        ide_setup_dma(hwif, mem->start);
 
+       idx[0] = i;
+
+       ide_device_add(idx, NULL);
+
+       if (!hwif->present)
+               goto out;
+
        return 0;
 out:
        printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");