ide: fix hwif-s initialization
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 16 Jul 2008 18:33:39 +0000 (20:33 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 16 Jul 2008 18:33:39 +0000 (20:33 +0200)
* Add ide_hwifs[] entry initialization to ide_find_port_slot()
  and remove ide_init_port_data() calls from host drivers.

* Unexport ide_init_port_data().

* Remove no longer needed init_ide_data().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
12 files changed:
drivers/ide/arm/palm_bk3710.c
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-pnp.c
drivers/ide/ide-probe.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

index 9b8a45d2cf171077c260b4872669909ae24e56cb..c79b85b6e4a34e82b135cee906842656bc3652a9 100644 (file)
@@ -400,7 +400,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 
        i = hwif->index;
 
-       ide_init_port_data(hwif, i);
        ide_init_port_hw(hwif, &hw);
 
        default_hwif_mmiops(hwif);
index ae37ee58bae27a474f80fc3e72edbafc6528cad2..dfce105bae641a98ca0c779b9d09174325d1a037 100644 (file)
@@ -199,7 +199,6 @@ static int __init h8300_ide_init(void)
        }
 
        index = hwif->index;
-       ide_init_port_data(hwif, index);
        ide_init_port_hw(hwif, &hw);
        hwif_setup(hwif);
        hwif->host_flags = IDE_HFLAG_NO_IO_32BIT;
index adbd01784162453968ce3a4c33a035591d97b679..fc1e10c9d1cd432967ec7e84d1faca6de5a1ebb3 100644 (file)
@@ -62,7 +62,6 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
                u8 index = hwif->index;
                u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
-               ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
index d21e51a02c3e9c17579e64cf7a886b66dc77207c..592d424412ea9c193ab98aeb6828da6935607901 100644 (file)
@@ -1473,22 +1473,26 @@ ide_hwif_t *ide_find_port_slot(const struct ide_port_info *d)
                for (; i < MAX_HWIFS; i++) {
                        hwif = &ide_hwifs[i];
                        if (hwif->chipset == ide_unknown)
-                               return hwif;
+                               goto out_found;
                }
        } else {
                for (i = 2; i < MAX_HWIFS; i++) {
                        hwif = &ide_hwifs[i];
                        if (hwif->chipset == ide_unknown)
-                               return hwif;
+                               goto out_found;
                }
                for (i = 0; i < 2 && i < MAX_HWIFS; i++) {
                        hwif = &ide_hwifs[i];
                        if (hwif->chipset == ide_unknown)
-                               return hwif;
+                               goto out_found;
                }
        }
 
        return NULL;
+
+out_found:
+       ide_init_port_data(hwif, i);
+       return hwif;
 }
 EXPORT_SYMBOL_GPL(ide_find_port_slot);
 
index 2b8453510e0900211b21ad6d742070fac1556151..32d8ee281d56b9f8db91861ec6c6da4c51953af8 100644 (file)
@@ -121,7 +121,6 @@ void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
 
        ide_port_init_devices_data(hwif);
 }
-EXPORT_SYMBOL_GPL(ide_init_port_data);
 
 static void ide_port_init_devices_data(ide_hwif_t *hwif)
 {
@@ -150,18 +149,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
        }
 }
 
-static void __init init_ide_data (void)
-{
-       unsigned int index;
-
-       /* Initialise all interface structures */
-       for (index = 0; index < MAX_HWIFS; ++index) {
-               ide_hwif_t *hwif = &ide_hwifs[index];
-
-               ide_init_port_data(hwif, index);
-       }
-}
-
 void ide_remove_port_from_hwgroup(ide_hwif_t *hwif)
 {
        ide_hwgroup_t *hwgroup = hwif->hwgroup;
@@ -1021,8 +1008,6 @@ static int __init ide_init(void)
                goto out_port_class;
        }
 
-       init_ide_data();
-
        proc_ide_create();
 
        return 0;
index 9a1d27ef3f8a0c3766df51e3c8444c7a8dcb295c..0497e7f85b09112c5fb39c1e5901e3d4231cb6f4 100644 (file)
@@ -227,7 +227,6 @@ fail_base2:
                        if (hwif) {
                                u8 index = hwif->index;
 
-                               ide_init_port_data(hwif, index);
                                ide_init_port_hw(hwif, &hw);
 
                                idx[i] = index;
index af11028b47949afbb207946831f4c2bba78bfd0d..129a812bb57f5f124e4f3d7ef8f43b3356501c9f 100644 (file)
@@ -111,7 +111,6 @@ static int __init falconide_init(void)
                u8 index = hwif->index;
                u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
-               ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                /* Atari has a byte-swapped IDE interface */
index b78941680c320b4542a75d0d894c72e9e53e9098..7e74b20202dff34fc1edfe79c1503e85bb28a13d 100644 (file)
@@ -185,7 +185,6 @@ found:
        if (hwif) {
            u8 index = hwif->index;
 
-           ide_init_port_data(hwif, index);
            ide_init_port_hw(hwif, &hw);
 
            idx[i] = index;
index 8dbf4d9b6447cdd6e6bf2add89382b1f55ec0213..7c69608154c22c96c6c4842ff5bd441768c2e6b8 100644 (file)
@@ -187,7 +187,6 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl,
 
     i = hwif->index;
 
-    ide_init_port_data(hwif, i);
     ide_init_port_hw(hwif, &hw);
     hwif->port_ops = &idecs_port_ops;
 
index 2e84290d0bcc6bacb68142ab7c1e4756568ca876..0a6195bcfeda40681da03a0e53dfe3d769a802be 100644 (file)
@@ -130,7 +130,6 @@ static int __init macide_init(void)
                u8 index = hwif->index;
                u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
-               ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                ide_device_add(idx, NULL);
index 8ff6e2d208340198c60e788b4f8a73e47062fd73..9c2b9d078f69e5bc993e5d9fc88a0b0f03d9669d 100644 (file)
@@ -142,7 +142,6 @@ static int __init q40ide_init(void)
 
        hwif = ide_find_port();
        if (hwif) {
-               ide_init_port_data(hwif, hwif->index);
                ide_init_port_hw(hwif, &hw);
 
                /* Q40 has a byte-swapped IDE interface */
index af0f30051d5adbbbc39ead132b30e974779fdd98..0106e2a2df77a3ab8c42fd9092e440c3a309a9b9 100644 (file)
@@ -93,7 +93,6 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
 
        i = hwif->index;
 
-       ide_init_port_data(hwif, i);
        ide_init_port_hw(hwif, &hw);
 
        idx[0] = i;