ide: add "initializing" argument to ide_register_hw()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 9 May 2007 22:01:10 +0000 (00:01 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 9 May 2007 22:01:10 +0000 (00:01 +0200)
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>
15 files changed:
drivers/ide/arm/bast-ide.c
drivers/ide/arm/ide_arm.c
drivers/ide/cris/ide-cris.c
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-pnp.c
drivers/ide/ide.c
drivers/ide/legacy/buddha.c
drivers/ide/legacy/falconide.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/ide-cs.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/q40ide.c
drivers/ide/pci/delkin_cb.c
drivers/macintosh/mediabay.c
include/linux/ide.h

index 9d474e5fd8dc49484b555651c925fe22561147a5..f7449d04114a1b1e984917e35fb23755424abaf3 100644 (file)
@@ -45,7 +45,7 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
        hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
        hw.irq = irq;
 
-       ide_register_hw(&hw, hwif);
+       ide_register_hw(&hw, 0, hwif);
 
        return 0;
 }
index 23488c4d1fcdca96c987fd2838dd3961a88104aa..a3d6744e870a18870e7b98a23129e76b78cce34c 100644 (file)
@@ -38,6 +38,6 @@ void __init ide_arm_init(void)
                memset(&hw, 0, sizeof(hw));
                ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
                hw.irq = IDE_ARM_IRQ;
-               ide_register_hw(&hw, NULL);
+               ide_register_hw(&hw, 1, NULL);
        }
 }
index 9691d089fce85a2d3d3ae903b05fac5255d213fc..c04cb25a01ff4ee2c8a9e0e2f60599bd11fc3d66 100644 (file)
@@ -796,7 +796,7 @@ init_e100_ide (void)
                                ide_offsets,
                                0, 0, cris_ide_ack_intr,
                                ide_default_irq(0));
-               ide_register_hw(&hw, &hwif);
+               ide_register_hw(&hw, 1, &hwif);
                hwif->mmio = 1;
                hwif->chipset = ide_etrax100;
                hwif->tuneproc = &tune_cris_ide;
index 88750a300337dfd122509564363fcf14335f3d31..6d26ad7360d52c35dd01ab897dafe24b8fd2dacd 100644 (file)
@@ -101,7 +101,7 @@ void __init h8300_ide_init(void)
        hw_setup(&hw);
 
        /* register if */
-       idx = ide_register_hw(&hw, &hwif);
+       idx = ide_register_hw(&hw, 1, &hwif);
        if (idx == -1) {
                printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
                return;
index 98410ca044cfc4c21a50f430f930a322588ab96c..2b8009c50e91363c1316c3a8bbfad6208e823942 100644 (file)
@@ -42,7 +42,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
        hw.irq = pnp_irq(dev, 0);
        hw.dma = NO_DMA;
 
-       index = ide_register_hw(&hw, &hwif);
+       index = ide_register_hw(&hw, 1, &hwif);
 
        if (index != -1) {
                printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
index 614c5fd43cd277025fe330944678520a3bbea4c8..0fc532850bbef92fad9085e1d8b03029f88ddc5f 100644 (file)
@@ -168,7 +168,6 @@ static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR,
 
 static int idebus_parameter;   /* holds the "idebus=" parameter */
 static int system_bus_speed;   /* holds what we think is VESA/PCI bus speed */
-static int initializing;       /* set while initializing built-in drivers */
 
 DECLARE_MUTEX(ide_cfg_sem);
  __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock);
@@ -302,9 +301,7 @@ static void __init init_ide_data (void)
 #endif
        }
 #ifdef CONFIG_IDE_ARM
-       initializing = 1;
        ide_arm_init();
-       initializing = 0;
 #endif
 }
 
@@ -749,6 +746,7 @@ void ide_setup_ports (      hw_regs_t *hw,
 /**
  *     ide_register_hw_with_fixup      -       register IDE interface
  *     @hw: hardware registers
+ *     @initializing: set while initializing built-in drivers
  *     @hwifp: pointer to returned hwif
  *     @fixup: fixup function
  *
@@ -758,7 +756,9 @@ void ide_setup_ports (      hw_regs_t *hw,
  *     Returns -1 on error.
  */
 
-int ide_register_hw_with_fixup(hw_regs_t *hw, ide_hwif_t **hwifp, void(*fixup)(ide_hwif_t *hwif))
+int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing,
+                              ide_hwif_t **hwifp,
+                              void(*fixup)(ide_hwif_t *hwif))
 {
        int index, retry = 1;
        ide_hwif_t *hwif;
@@ -810,9 +810,9 @@ found:
 
 EXPORT_SYMBOL(ide_register_hw_with_fixup);
 
-int ide_register_hw(hw_regs_t *hw, ide_hwif_t **hwifp)
+int ide_register_hw(hw_regs_t *hw, int initializing, ide_hwif_t **hwifp)
 {
-       return ide_register_hw_with_fixup(hw, hwifp, NULL);
+       return ide_register_hw_with_fixup(hw, initializing, hwifp, NULL);
 }
 
 EXPORT_SYMBOL(ide_register_hw);
@@ -1108,7 +1108,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
                        ide_init_hwif_ports(&hw, (unsigned long) args[0],
                                            (unsigned long) args[1], NULL);
                        hw.irq = args[2];
-                       if (ide_register_hw(&hw, NULL) == -1)
+                       if (ide_register_hw(&hw, 0, NULL) == -1)
                                return -EIO;
                        return 0;
                }
@@ -1819,10 +1819,8 @@ static int __init ide_init(void)
                (void)qd65xx_init();
 #endif
 
-       initializing = 1;
        /* Probe for special PCI and other "known" interface chipsets. */
        probe_for_hwifs();
-       initializing = 0;
 
        proc_ide_create();
 
index 1ed224a01f79ddd24e371740cccc55a4065e26fc..101aee1711c489c7985bc1d730e3ca6fb1452c29 100644 (file)
@@ -213,7 +213,7 @@ fail_base2:
                                                IRQ_AMIGA_PORTS);
                        }       
                        
-                       index = ide_register_hw(&hw, &hwif);
+                       index = ide_register_hw(&hw, 1, &hwif);
                        if (index != -1) {
                                hwif->mmio = 1;
                                printk("ide%d: ", index);
index a9f2cd5bb81e8419c31cad30e2eaa0a9db12a5b0..e1e9d9d6893fdd82990abdf124ae049c4e23c681 100644 (file)
@@ -70,7 +70,7 @@ void __init falconide_init(void)
                        0, 0, NULL,
 //                     falconide_iops,
                        IRQ_MFP_IDE);
-       index = ide_register_hw(&hw, NULL);
+       index = ide_register_hw(&hw, 1, NULL);
 
        if (index != -1)
            printk("ide%d: Falcon IDE interface\n", index);
index dcfadbbf55d88e0ccbe56b0abc831a63d9ecaab8..0830a021bbb609d4b103dc037239a0f2ec5bc934 100644 (file)
@@ -165,7 +165,7 @@ found:
 //                     &gayle_iops,
                        IRQ_AMIGA_PORTS);
 
-       index = ide_register_hw(&hw, &hwif);
+       index = ide_register_hw(&hw, 1, &hwif);
        if (index != -1) {
            hwif->mmio = 1;
            switch (i) {
index c6522a64d7ec31b60cf25f5fd063452c6b0a8ab5..2f3977f195b7fab9f31ebe509d2639ddcee923b6 100644 (file)
@@ -153,7 +153,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
     hw.irq = irq;
     hw.chipset = ide_pci;
     hw.dev = &handle->dev;
-    return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+    return ide_register_hw_with_fixup(&hw, 0, NULL, ide_undecoded_slave);
 }
 
 /*======================================================================
index 4c0079ad52ac16a9dd95df58e9afdde2a29239bf..c211fc78345d16b0c3f9da4ef96b8a1ff6c79bbd 100644 (file)
@@ -102,21 +102,21 @@ void macide_init(void)
                                0, 0, macide_ack_intr,
 //                             quadra_ide_iops,
                                IRQ_NUBUS_F);
-               index = ide_register_hw(&hw, &hwif);
+               index = ide_register_hw(&hw, 1, &hwif);
                break;
        case MAC_IDE_PB:
                ide_setup_ports(&hw, IDE_BASE, macide_offsets,
                                0, 0, macide_ack_intr,
 //                             macide_pb_iops,
                                IRQ_NUBUS_C);
-               index = ide_register_hw(&hw, &hwif);
+               index = ide_register_hw(&hw, 1, &hwif);
                break;
        case MAC_IDE_BABOON:
                ide_setup_ports(&hw, BABOON_BASE, macide_offsets,
                                0, 0, NULL,
 //                             macide_baboon_iops,
                                IRQ_BABOON_1);
-               index = ide_register_hw(&hw, &hwif);
+               index = ide_register_hw(&hw, 1, &hwif);
                if (index == -1) break;
                if (macintosh_config->ident == MAC_MODEL_PB190) {
 
index 74f08124eabb772f2d5f80abff23e4b11bfafecf..e628a983ce3395706cdf905c52a37eab15abc9d9 100644 (file)
@@ -142,7 +142,7 @@ void q40ide_init(void)
                        0, NULL,
 //                     m68kide_iops,
                        q40ide_default_irq(pcide_bases[i]));
-       index = ide_register_hw(&hw, &hwif);
+       index = ide_register_hw(&hw, 1, &hwif);
        // **FIXME**
        if (index != -1)
                hwif->mmio = 1;
index dd7ec37fdeab2d14ea76e855f7dd57e0961c84b1..46f4a888c03711c341eddaeea2be7933e3bcbf57 100644 (file)
@@ -80,7 +80,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
        hw.irq = dev->irq;
        hw.chipset = ide_pci;           /* this enables IRQ sharing */
 
-       rc = ide_register_hw_with_fixup(&hw, &hwif, ide_undecoded_slave);
+       rc = ide_register_hw_with_fixup(&hw, 0, &hwif, ide_undecoded_slave);
        if (rc < 0) {
                printk(KERN_ERR "delkin_cb: ide_register_hw failed (%d)\n", rc);
                pci_disable_device(dev);
index 0acf2f7fd9d725a3348d583306464211683021ac..c803d2bba65db3148a3bfd3060deebf4ae9a69af 100644 (file)
@@ -563,7 +563,7 @@ static void media_bay_step(int i)
                                ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL);
                                hw.irq = bay->cd_irq;
                                hw.chipset = ide_pmac;
-                               bay->cd_index = ide_register_hw(&hw, NULL);
+                               bay->cd_index = ide_register_hw(&hw, 0, NULL);
                                pmu_resume();
                        }
                        if (bay->cd_index == -1) {
index ca924b295c2e62580fced8da66aab2f1e9a1b22f..bdb97655ef61453be63f22168488b153644256b6 100644 (file)
@@ -223,8 +223,9 @@ typedef struct hw_regs_s {
 /*
  * Register new hardware with ide
  */
-int ide_register_hw(hw_regs_t *hw, struct hwif_s **hwifp);
-int ide_register_hw_with_fixup(hw_regs_t *, struct hwif_s **, void (*)(struct hwif_s *));
+int ide_register_hw(hw_regs_t *, int, struct hwif_s **);
+int ide_register_hw_with_fixup(hw_regs_t *, int, struct hwif_s **,
+                              void (*)(struct hwif_s *));
 
 /*
  * Set up hw_regs_t structure before calling ide_register_hw (optional)