aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:10 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:10 -0400
commit869c56ee9de1b72cd3f8ab9cdfbd3601e55c61f2 (patch)
tree0f295ba89c774f9a20b2b089a29f288cd80b8094 /drivers/ide/ide.c
parent7f8f48af0861c38c28d4abd550102643e0ea9e6a (diff)
ide: add "initializing" argument to ide_register_hw()
Add "initializing" argument to ide_register_hw() and use it instead of ide.c wide variable of the same name. Update all users of ide_register_hw() accordingly. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c16
1 files changed, 7 insertions, 9 deletions
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