aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/arm/bast-ide.c2
-rw-r--r--drivers/ide/arm/ide_arm.c2
-rw-r--r--drivers/ide/cris/ide-cris.c2
-rw-r--r--drivers/ide/h8300/ide-h8300.c2
-rw-r--r--drivers/ide/ide-pnp.c2
-rw-r--r--drivers/ide/ide.c16
-rw-r--r--drivers/ide/legacy/buddha.c2
-rw-r--r--drivers/ide/legacy/falconide.c2
-rw-r--r--drivers/ide/legacy/gayle.c2
-rw-r--r--drivers/ide/legacy/ide-cs.c2
-rw-r--r--drivers/ide/legacy/macide.c6
-rw-r--r--drivers/ide/legacy/q40ide.c2
-rw-r--r--drivers/ide/pci/delkin_cb.c2
-rw-r--r--drivers/macintosh/mediabay.c2
-rw-r--r--include/linux/ide.h5
15 files changed, 25 insertions, 26 deletions
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index 9d474e5fd8dc..f7449d04114a 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -45,7 +45,7 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
45 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); 45 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
46 hw.irq = irq; 46 hw.irq = irq;
47 47
48 ide_register_hw(&hw, hwif); 48 ide_register_hw(&hw, 0, hwif);
49 49
50 return 0; 50 return 0;
51} 51}
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index 23488c4d1fcd..a3d6744e870a 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -38,6 +38,6 @@ void __init ide_arm_init(void)
38 memset(&hw, 0, sizeof(hw)); 38 memset(&hw, 0, sizeof(hw));
39 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); 39 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
40 hw.irq = IDE_ARM_IRQ; 40 hw.irq = IDE_ARM_IRQ;
41 ide_register_hw(&hw, NULL); 41 ide_register_hw(&hw, 1, NULL);
42 } 42 }
43} 43}
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 9691d089fce8..c04cb25a01ff 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -796,7 +796,7 @@ init_e100_ide (void)
796 ide_offsets, 796 ide_offsets,
797 0, 0, cris_ide_ack_intr, 797 0, 0, cris_ide_ack_intr,
798 ide_default_irq(0)); 798 ide_default_irq(0));
799 ide_register_hw(&hw, &hwif); 799 ide_register_hw(&hw, 1, &hwif);
800 hwif->mmio = 1; 800 hwif->mmio = 1;
801 hwif->chipset = ide_etrax100; 801 hwif->chipset = ide_etrax100;
802 hwif->tuneproc = &tune_cris_ide; 802 hwif->tuneproc = &tune_cris_ide;
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index 88750a300337..6d26ad7360d5 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -101,7 +101,7 @@ void __init h8300_ide_init(void)
101 hw_setup(&hw); 101 hw_setup(&hw);
102 102
103 /* register if */ 103 /* register if */
104 idx = ide_register_hw(&hw, &hwif); 104 idx = ide_register_hw(&hw, 1, &hwif);
105 if (idx == -1) { 105 if (idx == -1) {
106 printk(KERN_ERR "ide-h8300: IDE I/F register failed\n"); 106 printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
107 return; 107 return;
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
index 98410ca044cf..2b8009c50e91 100644
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -42,7 +42,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
42 hw.irq = pnp_irq(dev, 0); 42 hw.irq = pnp_irq(dev, 0);
43 hw.dma = NO_DMA; 43 hw.dma = NO_DMA;
44 44
45 index = ide_register_hw(&hw, &hwif); 45 index = ide_register_hw(&hw, 1, &hwif);
46 46
47 if (index != -1) { 47 if (index != -1) {
48 printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); 48 printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 614c5fd43cd2..0fc532850bbe 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -168,7 +168,6 @@ static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR,
168 168
169static int idebus_parameter; /* holds the "idebus=" parameter */ 169static int idebus_parameter; /* holds the "idebus=" parameter */
170static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ 170static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */
171static int initializing; /* set while initializing built-in drivers */
172 171
173DECLARE_MUTEX(ide_cfg_sem); 172DECLARE_MUTEX(ide_cfg_sem);
174 __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock); 173 __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock);
@@ -302,9 +301,7 @@ static void __init init_ide_data (void)
302#endif 301#endif
303 } 302 }
304#ifdef CONFIG_IDE_ARM 303#ifdef CONFIG_IDE_ARM
305 initializing = 1;
306 ide_arm_init(); 304 ide_arm_init();
307 initializing = 0;
308#endif 305#endif
309} 306}
310 307
@@ -749,6 +746,7 @@ void ide_setup_ports ( hw_regs_t *hw,
749/** 746/**
750 * ide_register_hw_with_fixup - register IDE interface 747 * ide_register_hw_with_fixup - register IDE interface
751 * @hw: hardware registers 748 * @hw: hardware registers
749 * @initializing: set while initializing built-in drivers
752 * @hwifp: pointer to returned hwif 750 * @hwifp: pointer to returned hwif
753 * @fixup: fixup function 751 * @fixup: fixup function
754 * 752 *
@@ -758,7 +756,9 @@ void ide_setup_ports ( hw_regs_t *hw,
758 * Returns -1 on error. 756 * Returns -1 on error.
759 */ 757 */
760 758
761int ide_register_hw_with_fixup(hw_regs_t *hw, ide_hwif_t **hwifp, void(*fixup)(ide_hwif_t *hwif)) 759int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing,
760 ide_hwif_t **hwifp,
761 void(*fixup)(ide_hwif_t *hwif))
762{ 762{
763 int index, retry = 1; 763 int index, retry = 1;
764 ide_hwif_t *hwif; 764 ide_hwif_t *hwif;
@@ -810,9 +810,9 @@ found:
810 810
811EXPORT_SYMBOL(ide_register_hw_with_fixup); 811EXPORT_SYMBOL(ide_register_hw_with_fixup);
812 812
813int ide_register_hw(hw_regs_t *hw, ide_hwif_t **hwifp) 813int ide_register_hw(hw_regs_t *hw, int initializing, ide_hwif_t **hwifp)
814{ 814{
815 return ide_register_hw_with_fixup(hw, hwifp, NULL); 815 return ide_register_hw_with_fixup(hw, initializing, hwifp, NULL);
816} 816}
817 817
818EXPORT_SYMBOL(ide_register_hw); 818EXPORT_SYMBOL(ide_register_hw);
@@ -1108,7 +1108,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1108 ide_init_hwif_ports(&hw, (unsigned long) args[0], 1108 ide_init_hwif_ports(&hw, (unsigned long) args[0],
1109 (unsigned long) args[1], NULL); 1109 (unsigned long) args[1], NULL);
1110 hw.irq = args[2]; 1110 hw.irq = args[2];
1111 if (ide_register_hw(&hw, NULL) == -1) 1111 if (ide_register_hw(&hw, 0, NULL) == -1)
1112 return -EIO; 1112 return -EIO;
1113 return 0; 1113 return 0;
1114 } 1114 }
@@ -1819,10 +1819,8 @@ static int __init ide_init(void)
1819 (void)qd65xx_init(); 1819 (void)qd65xx_init();
1820#endif 1820#endif
1821 1821
1822 initializing = 1;
1823 /* Probe for special PCI and other "known" interface chipsets. */ 1822 /* Probe for special PCI and other "known" interface chipsets. */
1824 probe_for_hwifs(); 1823 probe_for_hwifs();
1825 initializing = 0;
1826 1824
1827 proc_ide_create(); 1825 proc_ide_create();
1828 1826
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 1ed224a01f79..101aee1711c4 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -213,7 +213,7 @@ fail_base2:
213 IRQ_AMIGA_PORTS); 213 IRQ_AMIGA_PORTS);
214 } 214 }
215 215
216 index = ide_register_hw(&hw, &hwif); 216 index = ide_register_hw(&hw, 1, &hwif);
217 if (index != -1) { 217 if (index != -1) {
218 hwif->mmio = 1; 218 hwif->mmio = 1;
219 printk("ide%d: ", index); 219 printk("ide%d: ", index);
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index a9f2cd5bb81e..e1e9d9d6893f 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -70,7 +70,7 @@ void __init falconide_init(void)
70 0, 0, NULL, 70 0, 0, NULL,
71// falconide_iops, 71// falconide_iops,
72 IRQ_MFP_IDE); 72 IRQ_MFP_IDE);
73 index = ide_register_hw(&hw, NULL); 73 index = ide_register_hw(&hw, 1, NULL);
74 74
75 if (index != -1) 75 if (index != -1)
76 printk("ide%d: Falcon IDE interface\n", index); 76 printk("ide%d: Falcon IDE interface\n", index);
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index dcfadbbf55d8..0830a021bbb6 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -165,7 +165,7 @@ found:
165// &gayle_iops, 165// &gayle_iops,
166 IRQ_AMIGA_PORTS); 166 IRQ_AMIGA_PORTS);
167 167
168 index = ide_register_hw(&hw, &hwif); 168 index = ide_register_hw(&hw, 1, &hwif);
169 if (index != -1) { 169 if (index != -1) {
170 hwif->mmio = 1; 170 hwif->mmio = 1;
171 switch (i) { 171 switch (i) {
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index c6522a64d7ec..2f3977f195b7 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -153,7 +153,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
153 hw.irq = irq; 153 hw.irq = irq;
154 hw.chipset = ide_pci; 154 hw.chipset = ide_pci;
155 hw.dev = &handle->dev; 155 hw.dev = &handle->dev;
156 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); 156 return ide_register_hw_with_fixup(&hw, 0, NULL, ide_undecoded_slave);
157} 157}
158 158
159/*====================================================================== 159/*======================================================================
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 4c0079ad52ac..c211fc78345d 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -102,21 +102,21 @@ void macide_init(void)
102 0, 0, macide_ack_intr, 102 0, 0, macide_ack_intr,
103// quadra_ide_iops, 103// quadra_ide_iops,
104 IRQ_NUBUS_F); 104 IRQ_NUBUS_F);
105 index = ide_register_hw(&hw, &hwif); 105 index = ide_register_hw(&hw, 1, &hwif);
106 break; 106 break;
107 case MAC_IDE_PB: 107 case MAC_IDE_PB:
108 ide_setup_ports(&hw, IDE_BASE, macide_offsets, 108 ide_setup_ports(&hw, IDE_BASE, macide_offsets,
109 0, 0, macide_ack_intr, 109 0, 0, macide_ack_intr,
110// macide_pb_iops, 110// macide_pb_iops,
111 IRQ_NUBUS_C); 111 IRQ_NUBUS_C);
112 index = ide_register_hw(&hw, &hwif); 112 index = ide_register_hw(&hw, 1, &hwif);
113 break; 113 break;
114 case MAC_IDE_BABOON: 114 case MAC_IDE_BABOON:
115 ide_setup_ports(&hw, BABOON_BASE, macide_offsets, 115 ide_setup_ports(&hw, BABOON_BASE, macide_offsets,
116 0, 0, NULL, 116 0, 0, NULL,
117// macide_baboon_iops, 117// macide_baboon_iops,
118 IRQ_BABOON_1); 118 IRQ_BABOON_1);
119 index = ide_register_hw(&hw, &hwif); 119 index = ide_register_hw(&hw, 1, &hwif);
120 if (index == -1) break; 120 if (index == -1) break;
121 if (macintosh_config->ident == MAC_MODEL_PB190) { 121 if (macintosh_config->ident == MAC_MODEL_PB190) {
122 122
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 74f08124eabb..e628a983ce33 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -142,7 +142,7 @@ void q40ide_init(void)
142 0, NULL, 142 0, NULL,
143// m68kide_iops, 143// m68kide_iops,
144 q40ide_default_irq(pcide_bases[i])); 144 q40ide_default_irq(pcide_bases[i]));
145 index = ide_register_hw(&hw, &hwif); 145 index = ide_register_hw(&hw, 1, &hwif);
146 // **FIXME** 146 // **FIXME**
147 if (index != -1) 147 if (index != -1)
148 hwif->mmio = 1; 148 hwif->mmio = 1;
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index dd7ec37fdeab..46f4a888c037 100644
--- a/drivers/ide/pci/delkin_cb.c
+++ b/drivers/ide/pci/delkin_cb.c
@@ -80,7 +80,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
80 hw.irq = dev->irq; 80 hw.irq = dev->irq;
81 hw.chipset = ide_pci; /* this enables IRQ sharing */ 81 hw.chipset = ide_pci; /* this enables IRQ sharing */
82 82
83 rc = ide_register_hw_with_fixup(&hw, &hwif, ide_undecoded_slave); 83 rc = ide_register_hw_with_fixup(&hw, 0, &hwif, ide_undecoded_slave);
84 if (rc < 0) { 84 if (rc < 0) {
85 printk(KERN_ERR "delkin_cb: ide_register_hw failed (%d)\n", rc); 85 printk(KERN_ERR "delkin_cb: ide_register_hw failed (%d)\n", rc);
86 pci_disable_device(dev); 86 pci_disable_device(dev);
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 0acf2f7fd9d7..c803d2bba65d 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -563,7 +563,7 @@ static void media_bay_step(int i)
563 ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL); 563 ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL);
564 hw.irq = bay->cd_irq; 564 hw.irq = bay->cd_irq;
565 hw.chipset = ide_pmac; 565 hw.chipset = ide_pmac;
566 bay->cd_index = ide_register_hw(&hw, NULL); 566 bay->cd_index = ide_register_hw(&hw, 0, NULL);
567 pmu_resume(); 567 pmu_resume();
568 } 568 }
569 if (bay->cd_index == -1) { 569 if (bay->cd_index == -1) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ca924b295c2e..bdb97655ef61 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -223,8 +223,9 @@ typedef struct hw_regs_s {
223/* 223/*
224 * Register new hardware with ide 224 * Register new hardware with ide
225 */ 225 */
226int ide_register_hw(hw_regs_t *hw, struct hwif_s **hwifp); 226int ide_register_hw(hw_regs_t *, int, struct hwif_s **);
227int ide_register_hw_with_fixup(hw_regs_t *, struct hwif_s **, void (*)(struct hwif_s *)); 227int ide_register_hw_with_fixup(hw_regs_t *, int, struct hwif_s **,
228 void (*)(struct hwif_s *));
228 229
229/* 230/*
230 * Set up hw_regs_t structure before calling ide_register_hw (optional) 231 * Set up hw_regs_t structure before calling ide_register_hw (optional)