aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:34 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:34 -0400
commit6d3803b68e29d898c29eab5185261682f8f07650 (patch)
tree987f1d15d4a1cf271f8d201c7219681bfd32d4ad /drivers/ide
parentdaaad24fdc2ed7cd45d9a09abdec46c0d34031a1 (diff)
cmd640: init hwif->{io_ports,irq} explicitly
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>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/pci/cmd640.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 6b8e4061d3c4..dbf0fa733b76 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -714,6 +714,7 @@ static int __init cmd640x_init(void)
714 unsigned int index; 714 unsigned int index;
715 u8 b, cfr; 715 u8 b, cfr;
716 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 716 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
717 hw_regs_t hw[2];
717 718
718 if (cmd640_vlb && probe_for_cmd640_vlb()) { 719 if (cmd640_vlb && probe_for_cmd640_vlb()) {
719 bus_type = "VLB"; 720 bus_type = "VLB";
@@ -752,12 +753,23 @@ static int __init cmd640x_init(void)
752 return 0; 753 return 0;
753 } 754 }
754 755
756 memset(&hw, 0, sizeof(hw));
757
758 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
759 hw[0].irq = 14;
760
761 ide_std_init_ports(&hw[1], 0x170, 0x376);
762 hw[1].irq = 15;
763
764 printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
765 "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
766
755 /* 767 /*
756 * Initialize data for primary port 768 * Initialize data for primary port
757 */ 769 */
758 setup_device_ptrs (); 770 setup_device_ptrs ();
759 printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n", 771
760 cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); 772 ide_init_port_hw(cmd_hwif0, &hw[0]);
761#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 773#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
762 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode; 774 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
763#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 775#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
@@ -810,6 +822,7 @@ static int __init cmd640x_init(void)
810 * Initialize data for secondary cmd640 port, if enabled 822 * Initialize data for secondary cmd640 port, if enabled
811 */ 823 */
812 if (second_port_cmd640) { 824 if (second_port_cmd640) {
825 ide_init_port_hw(cmd_hwif1, &hw[1]);
813#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 826#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
814 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode; 827 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
815#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 828#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */