]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
cmd640: init hwif->{io_ports,irq} explicitly
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)
Do explicit port setup instead of depending on init_ide_data().

This way hwif->io_ports[] and hwif->irq are always correctly set
regardless of CONFIG_PCI / CONFIG_BLK_DEV_IDEPCI.

While at it fix printk().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/cmd640.c

index 6b8e4061d3c42de1b5aa3d14bf87e24138d9185e..dbf0fa733b765caf9583bb3250bf8926521244e7 100644 (file)
@@ -714,6 +714,7 @@ static int __init cmd640x_init(void)
        unsigned int index;
        u8 b, cfr;
        u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       hw_regs_t hw[2];
 
        if (cmd640_vlb && probe_for_cmd640_vlb()) {
                bus_type = "VLB";
@@ -752,12 +753,23 @@ static int __init cmd640x_init(void)
                return 0;
        }
 
+       memset(&hw, 0, sizeof(hw));
+
+       ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
+       hw[0].irq = 14;
+
+       ide_std_init_ports(&hw[1], 0x170, 0x376);
+       hw[1].irq = 15;
+
+       printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
+                        "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
+
        /*
         * Initialize data for primary port
         */
        setup_device_ptrs ();
-       printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n",
-              cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr);
+
+       ide_init_port_hw(cmd_hwif0, &hw[0]);
 #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
        cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
@@ -810,6 +822,7 @@ static int __init cmd640x_init(void)
         * Initialize data for secondary cmd640 port, if enabled
         */
        if (second_port_cmd640) {
+               ide_init_port_hw(cmd_hwif1, &hw[1]);
 #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
                cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */