dt: Eliminate of_platform_{,un}register_driver
authorGrant Likely <grant.likely@secretlab.ca>
Thu, 17 Feb 2011 09:43:24 +0000 (02:43 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Mon, 28 Feb 2011 20:22:46 +0000 (13:22 -0700)
Final step to eliminate of_platform_bus_type.  They're all just
platform drivers now.

v2: fix type in pasemi_nand.c (thanks to Stephen Rothwell)

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
27 files changed:
drivers/ata/pata_mpc52xx.c
drivers/ata/pata_of_platform.c
drivers/ata/sata_dwc_460ex.c
drivers/ata/sata_fsl.c
drivers/atm/fore200e.c
drivers/block/xsysace.c
drivers/crypto/talitos.c
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-mpc.c
drivers/input/serio/xilinx_ps2.c
drivers/media/video/fsl-viu.c
drivers/mmc/host/sdhci-of-core.c
drivers/mtd/maps/physmap_of.c
drivers/mtd/maps/sun_uflash.c
drivers/mtd/nand/fsl_upm.c
drivers/mtd/nand/mpc5121_nfc.c
drivers/mtd/nand/ndfc.c
drivers/mtd/nand/pasemi_nand.c
drivers/mtd/nand/socrates_nand.c
drivers/pcmcia/electra_cf.c
drivers/pcmcia/m8xx_pcmcia.c
drivers/rtc/rtc-mpc5121.c
drivers/watchdog/cpwd.c
drivers/watchdog/gef_wdt.c
drivers/watchdog/mpc8xxx_wdt.c
drivers/watchdog/riowd.c

index d7d8026cde9948a562cf61f126fabd7960cafe5a..2fcac511d39c42179111cf8ce9396ebe29520f9d 100644 (file)
@@ -680,7 +680,7 @@ mpc52xx_ata_remove_one(struct device *dev)
 /* ======================================================================== */
 
 static int __devinit
-mpc52xx_ata_probe(struct platform_device *op, const struct of_device_id *match)
+mpc52xx_ata_probe(struct platform_device *op)
 {
        unsigned int ipb_freq;
        struct resource res_mem;
@@ -883,7 +883,7 @@ static struct of_device_id mpc52xx_ata_of_match[] = {
 };
 
 
-static struct of_platform_driver mpc52xx_ata_of_platform_driver = {
+static struct platform_driver mpc52xx_ata_of_platform_driver = {
        .probe          = mpc52xx_ata_probe,
        .remove         = mpc52xx_ata_remove,
 #ifdef CONFIG_PM
@@ -906,13 +906,13 @@ static int __init
 mpc52xx_ata_init(void)
 {
        printk(KERN_INFO "ata: MPC52xx IDE/ATA libata driver\n");
-       return of_register_platform_driver(&mpc52xx_ata_of_platform_driver);
+       return platform_driver_register(&mpc52xx_ata_of_platform_driver);
 }
 
 static void __exit
 mpc52xx_ata_exit(void)
 {
-       of_unregister_platform_driver(&mpc52xx_ata_of_platform_driver);
+       platform_driver_unregister(&mpc52xx_ata_of_platform_driver);
 }
 
 module_init(mpc52xx_ata_init);
index 480e043ce6b80e4b307977095c85df26cde6d558..f3054009bd254184b9c42ab375dfdc2622cdf519 100644 (file)
@@ -14,8 +14,7 @@
 #include <linux/of_platform.h>
 #include <linux/ata_platform.h>
 
-static int __devinit pata_of_platform_probe(struct platform_device *ofdev,
-                                           const struct of_device_id *match)
+static int __devinit pata_of_platform_probe(struct platform_device *ofdev)
 {
        int ret;
        struct device_node *dn = ofdev->dev.of_node;
@@ -90,7 +89,7 @@ static struct of_device_id pata_of_platform_match[] = {
 };
 MODULE_DEVICE_TABLE(of, pata_of_platform_match);
 
-static struct of_platform_driver pata_of_platform_driver = {
+static struct platform_driver pata_of_platform_driver = {
        .driver = {
                .name = "pata_of_platform",
                .owner = THIS_MODULE,
@@ -102,13 +101,13 @@ static struct of_platform_driver pata_of_platform_driver = {
 
 static int __init pata_of_platform_init(void)
 {
-       return of_register_platform_driver(&pata_of_platform_driver);
+       return platform_driver_register(&pata_of_platform_driver);
 }
 module_init(pata_of_platform_init);
 
 static void __exit pata_of_platform_exit(void)
 {
-       of_unregister_platform_driver(&pata_of_platform_driver);
+       platform_driver_unregister(&pata_of_platform_driver);
 }
 module_exit(pata_of_platform_exit);
 
index 6cf57c5c2b5f3d50d966e63bf1e1ad0d32dea13d..685a3a4b4d824ac2bad0267c1ad392146003eb84 100644 (file)
@@ -1588,8 +1588,7 @@ static const struct ata_port_info sata_dwc_port_info[] = {
        },
 };
 
-static int sata_dwc_probe(struct platform_device *ofdev,
-                       const struct of_device_id *match)
+static int sata_dwc_probe(struct platform_device *ofdev)
 {
        struct sata_dwc_device *hsdev;
        u32 idr, versionr;
@@ -1727,7 +1726,7 @@ static const struct of_device_id sata_dwc_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sata_dwc_match);
 
-static struct of_platform_driver sata_dwc_driver = {
+static struct platform_driver sata_dwc_driver = {
        .driver = {
                .name = DRV_NAME,
                .owner = THIS_MODULE,
@@ -1739,12 +1738,12 @@ static struct of_platform_driver sata_dwc_driver = {
 
 static int __init sata_dwc_init(void)
 {
-       return  of_register_platform_driver(&sata_dwc_driver);
+       return platform_driver_register(&sata_dwc_driver);
 }
 
 static void __exit sata_dwc_exit(void)
 {
-       of_unregister_platform_driver(&sata_dwc_driver);
+       platform_driver_unregister(&sata_dwc_driver);
 }
 
 module_init(sata_dwc_init);
index b0214d00d50bb469de76b40fb8a4f81f70cbb161..b843e8e9605ec5029af249330210138bcaf9694d 100644 (file)
@@ -1293,8 +1293,7 @@ static const struct ata_port_info sata_fsl_port_info[] = {
         },
 };
 
-static int sata_fsl_probe(struct platform_device *ofdev,
-                       const struct of_device_id *match)
+static int sata_fsl_probe(struct platform_device *ofdev)
 {
        int retval = -ENXIO;
        void __iomem *hcr_base = NULL;
@@ -1423,7 +1422,7 @@ static struct of_device_id fsl_sata_match[] = {
 
 MODULE_DEVICE_TABLE(of, fsl_sata_match);
 
-static struct of_platform_driver fsl_sata_driver = {
+static struct platform_driver fsl_sata_driver = {
        .driver = {
                .name = "fsl-sata",
                .owner = THIS_MODULE,
@@ -1439,13 +1438,13 @@ static struct of_platform_driver fsl_sata_driver = {
 
 static int __init sata_fsl_init(void)
 {
-       of_register_platform_driver(&fsl_sata_driver);
+       platform_driver_register(&fsl_sata_driver);
        return 0;
 }
 
 static void __exit sata_fsl_exit(void)
 {
-       of_unregister_platform_driver(&fsl_sata_driver);
+       platform_driver_unregister(&fsl_sata_driver);
 }
 
 MODULE_LICENSE("GPL");
index 44f778507770b50624dc2699953dcbad4a72d0c2..bdd2719f3f68382084fb04170b1c14022e442425 100644 (file)
@@ -2643,14 +2643,17 @@ fore200e_init(struct fore200e* fore200e, struct device *parent)
 }
 
 #ifdef CONFIG_SBUS
-static int __devinit fore200e_sba_probe(struct platform_device *op,
-                                       const struct of_device_id *match)
+static int __devinit fore200e_sba_probe(struct platform_device *op)
 {
-       const struct fore200e_bus *bus = match->data;
+       const struct fore200e_bus *bus;
        struct fore200e *fore200e;
        static int index = 0;
        int err;
 
+       if (!op->dev.of_match)
+               return -EINVAL;
+       bus = op->dev.of_match->data;
+
        fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL);
        if (!fore200e)
                return -ENOMEM;
@@ -2694,7 +2697,7 @@ static const struct of_device_id fore200e_sba_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fore200e_sba_match);
 
-static struct of_platform_driver fore200e_sba_driver = {
+static struct platform_driver fore200e_sba_driver = {
        .driver = {
                .name = "fore_200e",
                .owner = THIS_MODULE,
@@ -2795,7 +2798,7 @@ static int __init fore200e_module_init(void)
        printk(FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n");
 
 #ifdef CONFIG_SBUS
-       err = of_register_platform_driver(&fore200e_sba_driver);
+       err = platform_driver_register(&fore200e_sba_driver);
        if (err)
                return err;
 #endif
@@ -2806,7 +2809,7 @@ static int __init fore200e_module_init(void)
 
 #ifdef CONFIG_SBUS
        if (err)
-               of_unregister_platform_driver(&fore200e_sba_driver);
+               platform_driver_unregister(&fore200e_sba_driver);
 #endif
 
        return err;
@@ -2818,7 +2821,7 @@ static void __exit fore200e_module_cleanup(void)
        pci_unregister_driver(&fore200e_pca_driver);
 #endif
 #ifdef CONFIG_SBUS
-       of_unregister_platform_driver(&fore200e_sba_driver);
+       platform_driver_unregister(&fore200e_sba_driver);
 #endif
 }
 
index 829161edae53034d0d97ac72a56e6e46f02346ae..2c590a796aa1480bb24f2ce4e54814d971c56b76 100644 (file)
@@ -1195,16 +1195,13 @@ static struct platform_driver ace_platform_driver = {
  */
 
 #if defined(CONFIG_OF)
-static int __devinit
-ace_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit ace_of_probe(struct platform_device *op)
 {
        struct resource res;
        resource_size_t physaddr;
        const u32 *id;
        int irq, bus_width, rc;
 
-       dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match);
-
        /* device id */
        id = of_get_property(op->dev.of_node, "port-number", NULL);
 
@@ -1245,7 +1242,7 @@ static const struct of_device_id ace_of_match[] __devinitconst = {
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
 
-static struct of_platform_driver ace_of_driver = {
+static struct platform_driver ace_of_driver = {
        .probe = ace_of_probe,
        .remove = __devexit_p(ace_of_remove),
        .driver = {
@@ -1259,12 +1256,12 @@ static struct of_platform_driver ace_of_driver = {
 static inline int __init ace_of_register(void)
 {
        pr_debug("xsysace: registering OF binding\n");
-       return of_register_platform_driver(&ace_of_driver);
+       return platform_driver_register(&ace_of_driver);
 }
 
 static inline void __exit ace_of_unregister(void)
 {
-       of_unregister_platform_driver(&ace_of_driver);
+       platform_driver_unregister(&ace_of_driver);
 }
 #else /* CONFIG_OF */
 /* CONFIG_OF not enabled; do nothing helpers */
index b879c3f5d7c0a4a89e89315cee0eb6357e10ab29..854e2632f9a631bdeba2fbd3773d2a8686b7b86d 100644 (file)
@@ -2402,8 +2402,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
        return t_alg;
 }
 
-static int talitos_probe(struct platform_device *ofdev,
-                        const struct of_device_id *match)
+static int talitos_probe(struct platform_device *ofdev)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
@@ -2580,7 +2579,7 @@ static const struct of_device_id talitos_match[] = {
 };
 MODULE_DEVICE_TABLE(of, talitos_match);
 
-static struct of_platform_driver talitos_driver = {
+static struct platform_driver talitos_driver = {
        .driver = {
                .name = "talitos",
                .owner = THIS_MODULE,
@@ -2592,13 +2591,13 @@ static struct of_platform_driver talitos_driver = {
 
 static int __init talitos_init(void)
 {
-       return of_register_platform_driver(&talitos_driver);
+       return platform_driver_register(&talitos_driver);
 }
 module_init(talitos_init);
 
 static void __exit talitos_exit(void)
 {
-       of_unregister_platform_driver(&talitos_driver);
+       platform_driver_unregister(&talitos_driver);
 }
 module_exit(talitos_exit);
 
index f2de3be35df36265cdfca5d899097b161ef10171..3a20961bef1e4e675472b9e5ab5886910ea03d46 100644 (file)
@@ -634,8 +634,7 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
                cpm_muram_free(cpm->i2c_addr);
 }
 
-static int __devinit cpm_i2c_probe(struct platform_device *ofdev,
-                        const struct of_device_id *match)
+static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
 {
        int result, len;
        struct cpm_i2c *cpm;
@@ -718,7 +717,7 @@ static const struct of_device_id cpm_i2c_match[] = {
 
 MODULE_DEVICE_TABLE(of, cpm_i2c_match);
 
-static struct of_platform_driver cpm_i2c_driver = {
+static struct platform_driver cpm_i2c_driver = {
        .probe          = cpm_i2c_probe,
        .remove         = __devexit_p(cpm_i2c_remove),
        .driver = {
@@ -730,12 +729,12 @@ static struct of_platform_driver cpm_i2c_driver = {
 
 static int __init cpm_i2c_init(void)
 {
-       return of_register_platform_driver(&cpm_i2c_driver);
+       return platform_driver_register(&cpm_i2c_driver);
 }
 
 static void __exit cpm_i2c_exit(void)
 {
-       of_unregister_platform_driver(&cpm_i2c_driver);
+       platform_driver_unregister(&cpm_i2c_driver);
 }
 
 module_init(cpm_i2c_init);
index 6e3c38240336234562ee765ea95687fb2c3ed684..e4f88dca99b5d1fc4bbc0346fd2ea5ce13ef8d9b 100644 (file)
@@ -691,8 +691,7 @@ static int __devinit iic_request_irq(struct platform_device *ofdev,
 /*
  * Register single IIC interface
  */
-static int __devinit iic_probe(struct platform_device *ofdev,
-                              const struct of_device_id *match)
+static int __devinit iic_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct ibm_iic_private *dev;
@@ -806,7 +805,7 @@ static const struct of_device_id ibm_iic_match[] = {
        {}
 };
 
-static struct of_platform_driver ibm_iic_driver = {
+static struct platform_driver ibm_iic_driver = {
        .driver = {
                .name = "ibm-iic",
                .owner = THIS_MODULE,
@@ -818,12 +817,12 @@ static struct of_platform_driver ibm_iic_driver = {
 
 static int __init iic_init(void)
 {
-       return of_register_platform_driver(&ibm_iic_driver);
+       return platform_driver_register(&ibm_iic_driver);
 }
 
 static void __exit iic_exit(void)
 {
-       of_unregister_platform_driver(&ibm_iic_driver);
+       platform_driver_unregister(&ibm_iic_driver);
 }
 
 module_init(iic_init);
index b74e6dc6886c71ed5ebe3e02f219a68f8f0a2df8..75b984c519acd18750f5ce2b6002e60c152c5b21 100644 (file)
@@ -560,8 +560,7 @@ static struct i2c_adapter mpc_ops = {
        .timeout = HZ,
 };
 
-static int __devinit fsl_i2c_probe(struct platform_device *op,
-                                  const struct of_device_id *match)
+static int __devinit fsl_i2c_probe(struct platform_device *op)
 {
        struct mpc_i2c *i2c;
        const u32 *prop;
@@ -569,6 +568,9 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
        int result = 0;
        int plen;
 
+       if (!op->dev.of_match)
+               return -EINVAL;
+
        i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
        if (!i2c)
                return -ENOMEM;
@@ -603,8 +605,8 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
                        clock = *prop;
        }
 
-       if (match->data) {
-               struct mpc_i2c_data *data = match->data;
+       if (op->dev.of_match->data) {
+               struct mpc_i2c_data *data = op->dev.of_match->data;
                data->setup(op->dev.of_node, i2c, clock, data->prescaler);
        } else {
                /* Backwards compatibility */
@@ -700,7 +702,7 @@ static const struct of_device_id mpc_i2c_of_match[] = {
 MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
 
 /* Structure for a device driver */
-static struct of_platform_driver mpc_i2c_driver = {
+static struct platform_driver mpc_i2c_driver = {
        .probe          = fsl_i2c_probe,
        .remove         = __devexit_p(fsl_i2c_remove),
        .driver = {
@@ -712,18 +714,12 @@ static struct of_platform_driver mpc_i2c_driver = {
 
 static int __init fsl_i2c_init(void)
 {
-       int rv;
-
-       rv = of_register_platform_driver(&mpc_i2c_driver);
-       if (rv)
-               printk(KERN_ERR DRV_NAME
-                      " of_register_platform_driver failed (%i)\n", rv);
-       return rv;
+       return platform_driver_register(&mpc_i2c_driver);
 }
 
 static void __exit fsl_i2c_exit(void)
 {
-       of_unregister_platform_driver(&mpc_i2c_driver);
+       platform_driver_unregister(&mpc_i2c_driver);
 }
 
 module_init(fsl_i2c_init);
index bb14449fb0223d784ab233690df5932208965b88..7540bafc95cf0c484aeca708116f1e94bcec3ef4 100644 (file)
@@ -232,8 +232,7 @@ static void sxps2_close(struct serio *pserio)
  * It returns 0, if the driver is bound to the PS/2 device, or a negative
  * value if there is an error.
  */
-static int __devinit xps2_of_probe(struct platform_device *ofdev,
-                                  const struct of_device_id *match)
+static int __devinit xps2_of_probe(struct platform_device *ofdev)
 {
        struct resource r_irq; /* Interrupt resources */
        struct resource r_mem; /* IO mem resources */
@@ -361,7 +360,7 @@ static const struct of_device_id xps2_of_match[] __devinitconst = {
 };
 MODULE_DEVICE_TABLE(of, xps2_of_match);
 
-static struct of_platform_driver xps2_of_driver = {
+static struct platform_driver xps2_of_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -373,12 +372,12 @@ static struct of_platform_driver xps2_of_driver = {
 
 static int __init xps2_init(void)
 {
-       return of_register_platform_driver(&xps2_of_driver);
+       return platform_driver_register(&xps2_of_driver);
 }
 
 static void __exit xps2_cleanup(void)
 {
-       of_unregister_platform_driver(&xps2_of_driver);
+       platform_driver_unregister(&xps2_of_driver);
 }
 
 module_init(xps2_init);
index e4bba88254c7940708047d596195cb0c935e1ce4..031af1610154549d0a494b00913da13c654c1535 100644 (file)
@@ -1445,8 +1445,7 @@ static struct video_device viu_template = {
        .current_norm   = V4L2_STD_NTSC_M,
 };
 
-static int __devinit viu_of_probe(struct platform_device *op,
-                                 const struct of_device_id *match)
+static int __devinit viu_of_probe(struct platform_device *op)
 {
        struct viu_dev *viu_dev;
        struct video_device *vdev;
@@ -1627,7 +1626,7 @@ static struct of_device_id mpc512x_viu_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mpc512x_viu_of_match);
 
-static struct of_platform_driver viu_of_platform_driver = {
+static struct platform_driver viu_of_platform_driver = {
        .probe = viu_of_probe,
        .remove = __devexit_p(viu_of_remove),
 #ifdef CONFIG_PM
@@ -1643,12 +1642,12 @@ static struct of_platform_driver viu_of_platform_driver = {
 
 static int __init viu_init(void)
 {
-       return of_register_platform_driver(&viu_of_platform_driver);
+       return platform_driver_register(&viu_of_platform_driver);
 }
 
 static void __exit viu_exit(void)
 {
-       of_unregister_platform_driver(&viu_of_platform_driver);
+       platform_driver_unregister(&viu_of_platform_driver);
 }
 
 module_init(viu_init);
index dd84124f4209314bd571a61a172cbbcf24285cf9..f9b611fc773e19d9133e79681280164c9e4d8538 100644 (file)
@@ -124,17 +124,20 @@ static bool __devinit sdhci_of_wp_inverted(struct device_node *np)
 #endif
 }
 
-static int __devinit sdhci_of_probe(struct platform_device *ofdev,
-                                const struct of_device_id *match)
+static int __devinit sdhci_of_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
-       struct sdhci_of_data *sdhci_of_data = match->data;
+       struct sdhci_of_data *sdhci_of_data;
        struct sdhci_host *host;
        struct sdhci_of_host *of_host;
        const __be32 *clk;
        int size;
        int ret;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+       sdhci_of_data = ofdev->dev.of_match->data;
+
        if (!of_device_is_available(np))
                return -ENODEV;
 
@@ -217,7 +220,7 @@ static const struct of_device_id sdhci_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sdhci_of_match);
 
-static struct of_platform_driver sdhci_of_driver = {
+static struct platform_driver sdhci_of_driver = {
        .driver = {
                .name = "sdhci-of",
                .owner = THIS_MODULE,
@@ -231,13 +234,13 @@ static struct of_platform_driver sdhci_of_driver = {
 
 static int __init sdhci_of_init(void)
 {
-       return of_register_platform_driver(&sdhci_of_driver);
+       return platform_driver_register(&sdhci_of_driver);
 }
 module_init(sdhci_of_init);
 
 static void __exit sdhci_of_exit(void)
 {
-       of_unregister_platform_driver(&sdhci_of_driver);
+       platform_driver_unregister(&sdhci_of_driver);
 }
 module_exit(sdhci_of_exit);
 
index 8506578e6a352084b37593492e13751f60eb4925..3db0cb083d312207f0ca3dd9446a448ddcc4399c 100644 (file)
@@ -216,8 +216,7 @@ static void __devinit of_free_probes(const char **probes)
 }
 #endif
 
-static int __devinit of_flash_probe(struct platform_device *dev,
-                                   const struct of_device_id *match)
+static int __devinit of_flash_probe(struct platform_device *dev)
 {
 #ifdef CONFIG_MTD_PARTITIONS
        const char **part_probe_types;
@@ -225,7 +224,7 @@ static int __devinit of_flash_probe(struct platform_device *dev,
        struct device_node *dp = dev->dev.of_node;
        struct resource res;
        struct of_flash *info;
-       const char *probe_type = match->data;
+       const char *probe_type;
        const __be32 *width;
        int err;
        int i;
@@ -235,6 +234,10 @@ static int __devinit of_flash_probe(struct platform_device *dev,
        struct mtd_info **mtd_list = NULL;
        resource_size_t res_size;
 
+       if (!dev->dev.of_match)
+               return -EINVAL;
+       probe_type = dev->dev.of_match->data;
+
        reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32);
 
        /*
@@ -418,7 +421,7 @@ static struct of_device_id of_flash_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_flash_match);
 
-static struct of_platform_driver of_flash_driver = {
+static struct platform_driver of_flash_driver = {
        .driver = {
                .name = "of-flash",
                .owner = THIS_MODULE,
@@ -430,12 +433,12 @@ static struct of_platform_driver of_flash_driver = {
 
 static int __init of_flash_init(void)
 {
-       return of_register_platform_driver(&of_flash_driver);
+       return platform_driver_register(&of_flash_driver);
 }
 
 static void __exit of_flash_exit(void)
 {
-       of_unregister_platform_driver(&of_flash_driver);
+       platform_driver_unregister(&of_flash_driver);
 }
 
 module_init(of_flash_init);
index 3582ba1f9b0916b54a13f31dbf970bcfbe7093b0..3f1cb328a574dd6e7e01cf47a1c12509f3fc2630 100644 (file)
@@ -108,7 +108,7 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)
        return 0;
 }
 
-static int __devinit uflash_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit uflash_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
 
@@ -148,7 +148,7 @@ static const struct of_device_id uflash_match[] = {
 
 MODULE_DEVICE_TABLE(of, uflash_match);
 
-static struct of_platform_driver uflash_driver = {
+static struct platform_driver uflash_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -160,12 +160,12 @@ static struct of_platform_driver uflash_driver = {
 
 static int __init uflash_init(void)
 {
-       return of_register_platform_driver(&uflash_driver);
+       return platform_driver_register(&uflash_driver);
 }
 
 static void __exit uflash_exit(void)
 {
-       of_unregister_platform_driver(&uflash_driver);
+       platform_driver_unregister(&uflash_driver);
 }
 
 module_init(uflash_init);
index efdcca94ce559f8aa6b6e7c9a2c3c994cc6bbb84..073ee026a17c21d775d86cdfe3f66875bbefda3c 100644 (file)
@@ -217,8 +217,7 @@ err:
        return ret;
 }
 
-static int __devinit fun_probe(struct platform_device *ofdev,
-                              const struct of_device_id *ofid)
+static int __devinit fun_probe(struct platform_device *ofdev)
 {
        struct fsl_upm_nand *fun;
        struct resource io_res;
@@ -360,7 +359,7 @@ static const struct of_device_id of_fun_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_fun_match);
 
-static struct of_platform_driver of_fun_driver = {
+static struct platform_driver of_fun_driver = {
        .driver = {
                .name = "fsl,upm-nand",
                .owner = THIS_MODULE,
@@ -372,13 +371,13 @@ static struct of_platform_driver of_fun_driver = {
 
 static int __init fun_module_init(void)
 {
-       return of_register_platform_driver(&of_fun_driver);
+       return platform_driver_register(&of_fun_driver);
 }
 module_init(fun_module_init);
 
 static void __exit fun_module_exit(void)
 {
-       of_unregister_platform_driver(&of_fun_driver);
+       platform_driver_unregister(&of_fun_driver);
 }
 module_exit(fun_module_exit);
 
index 469e649c911c83e1ac8d9c3d7f81be7ece2135fc..c2f95437e5e920ebc105a2d62f86d420d9c3130a 100644 (file)
@@ -650,8 +650,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
                iounmap(prv->csreg);
 }
 
-static int __devinit mpc5121_nfc_probe(struct platform_device *op,
-                                       const struct of_device_id *match)
+static int __devinit mpc5121_nfc_probe(struct platform_device *op)
 {
        struct device_node *rootnode, *dn = op->dev.of_node;
        struct device *dev = &op->dev;
@@ -891,7 +890,7 @@ static struct of_device_id mpc5121_nfc_match[] __devinitdata = {
        {},
 };
 
-static struct of_platform_driver mpc5121_nfc_driver = {
+static struct platform_driver mpc5121_nfc_driver = {
        .probe          = mpc5121_nfc_probe,
        .remove         = __devexit_p(mpc5121_nfc_remove),
        .driver         = {
@@ -903,14 +902,14 @@ static struct of_platform_driver mpc5121_nfc_driver = {
 
 static int __init mpc5121_nfc_init(void)
 {
-       return of_register_platform_driver(&mpc5121_nfc_driver);
+       return platform_driver_register(&mpc5121_nfc_driver);
 }
 
 module_init(mpc5121_nfc_init);
 
 static void __exit mpc5121_nfc_cleanup(void)
 {
-       of_unregister_platform_driver(&mpc5121_nfc_driver);
+       platform_driver_unregister(&mpc5121_nfc_driver);
 }
 
 module_exit(mpc5121_nfc_cleanup);
index c9ae0a5023b673e866716eaa58bbf02c368e7346..bbe6d451290d93d4824a58bdf0966666caef6283 100644 (file)
@@ -225,8 +225,7 @@ err:
        return ret;
 }
 
-static int __devinit ndfc_probe(struct platform_device *ofdev,
-                               const struct of_device_id *match)
+static int __devinit ndfc_probe(struct platform_device *ofdev)
 {
        struct ndfc_controller *ndfc = &ndfc_ctrl;
        const __be32 *reg;
@@ -292,7 +291,7 @@ static const struct of_device_id ndfc_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ndfc_match);
 
-static struct of_platform_driver ndfc_driver = {
+static struct platform_driver ndfc_driver = {
        .driver = {
                .name = "ndfc",
                .owner = THIS_MODULE,
@@ -304,12 +303,12 @@ static struct of_platform_driver ndfc_driver = {
 
 static int __init ndfc_nand_init(void)
 {
-       return of_register_platform_driver(&ndfc_driver);
+       return platform_driver_register(&ndfc_driver);
 }
 
 static void __exit ndfc_nand_exit(void)
 {
-       of_unregister_platform_driver(&ndfc_driver);
+       platform_driver_unregister(&ndfc_driver);
 }
 
 module_init(ndfc_nand_init);
index bb277a54986f0bbe5554d0f7af0f78942031d530..59efa829ef24f79d9b446da8b175b448acf60a7f 100644 (file)
@@ -89,8 +89,7 @@ int pasemi_device_ready(struct mtd_info *mtd)
        return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR);
 }
 
-static int __devinit pasemi_nand_probe(struct platform_device *ofdev,
-                                     const struct of_device_id *match)
+static int __devinit pasemi_nand_probe(struct platform_device *ofdev)
 {
        struct pci_dev *pdev;
        struct device_node *np = ofdev->dev.of_node;
@@ -219,7 +218,7 @@ static const struct of_device_id pasemi_nand_match[] =
 
 MODULE_DEVICE_TABLE(of, pasemi_nand_match);
 
-static struct of_platform_driver pasemi_nand_driver =
+static struct platform_driver pasemi_nand_driver =
 {
        .driver = {
                .name = (char*)driver_name,
@@ -232,13 +231,13 @@ static struct of_platform_driver pasemi_nand_driver =
 
 static int __init pasemi_nand_init(void)
 {
-       return of_register_platform_driver(&pasemi_nand_driver);
+       return platform_driver_register(&pasemi_nand_driver);
 }
 module_init(pasemi_nand_init);
 
 static void __exit pasemi_nand_exit(void)
 {
-       of_unregister_platform_driver(&pasemi_nand_driver);
+       platform_driver_unregister(&pasemi_nand_driver);
 }
 module_exit(pasemi_nand_exit);
 
index a8e403eebedb558dc8d77308b47572aa0d4fcd79..a853548986f0ebdb69d20756b20a04f400f0d8f9 100644 (file)
@@ -162,8 +162,7 @@ static const char *part_probes[] = { "cmdlinepart", NULL };
 /*
  * Probe for the NAND device.
  */
-static int __devinit socrates_nand_probe(struct platform_device *ofdev,
-                                        const struct of_device_id *ofid)
+static int __devinit socrates_nand_probe(struct platform_device *ofdev)
 {
        struct socrates_nand_host *host;
        struct mtd_info *mtd;
@@ -300,7 +299,7 @@ static const struct of_device_id socrates_nand_match[] =
 
 MODULE_DEVICE_TABLE(of, socrates_nand_match);
 
-static struct of_platform_driver socrates_nand_driver = {
+static struct platform_driver socrates_nand_driver = {
        .driver = {
                .name = "socrates_nand",
                .owner = THIS_MODULE,
@@ -312,12 +311,12 @@ static struct of_platform_driver socrates_nand_driver = {
 
 static int __init socrates_nand_init(void)
 {
-       return of_register_platform_driver(&socrates_nand_driver);
+       return platform_driver_register(&socrates_nand_driver);
 }
 
 static void __exit socrates_nand_exit(void)
 {
-       of_unregister_platform_driver(&socrates_nand_driver);
+       platform_driver_unregister(&socrates_nand_driver);
 }
 
 module_init(socrates_nand_init);
index 546d3024b6f01f07c8cf1315e964cb855f6d0baf..6defd4a8168ee27597872c718d58a2f60804e9fe 100644 (file)
@@ -181,8 +181,7 @@ static struct pccard_operations electra_cf_ops = {
        .set_mem_map            = electra_cf_set_mem_map,
 };
 
-static int __devinit electra_cf_probe(struct platform_device *ofdev,
-                                     const struct of_device_id *match)
+static int __devinit electra_cf_probe(struct platform_device *ofdev)
 {
        struct device *device = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
@@ -356,7 +355,7 @@ static const struct of_device_id electra_cf_match[] = {
 };
 MODULE_DEVICE_TABLE(of, electra_cf_match);
 
-static struct of_platform_driver electra_cf_driver = {
+static struct platform_driver electra_cf_driver = {
        .driver = {
                .name = (char *)driver_name,
                .owner = THIS_MODULE,
@@ -368,13 +367,13 @@ static struct of_platform_driver electra_cf_driver = {
 
 static int __init electra_cf_init(void)
 {
-       return of_register_platform_driver(&electra_cf_driver);
+       return platform_driver_register(&electra_cf_driver);
 }
 module_init(electra_cf_init);
 
 static void __exit electra_cf_exit(void)
 {
-       of_unregister_platform_driver(&electra_cf_driver);
+       platform_driver_unregister(&electra_cf_driver);
 }
 module_exit(electra_cf_exit);
 
index 0db482771fb5d928833dfbcc56700e3fb4daf0f4..271a590a5f3cb5418ee8a53c8b59ae7edcef32c2 100644 (file)
@@ -1148,8 +1148,7 @@ static struct pccard_operations m8xx_services = {
        .set_mem_map = m8xx_set_mem_map,
 };
 
-static int __init m8xx_probe(struct platform_device *ofdev,
-                            const struct of_device_id *match)
+static int __init m8xx_probe(struct platform_device *ofdev)
 {
        struct pcmcia_win *w;
        unsigned int i, m, hwirq;
@@ -1295,7 +1294,7 @@ static const struct of_device_id m8xx_pcmcia_match[] = {
 
 MODULE_DEVICE_TABLE(of, m8xx_pcmcia_match);
 
-static struct of_platform_driver m8xx_pcmcia_driver = {
+static struct platform_driver m8xx_pcmcia_driver = {
        .driver = {
                .name = driver_name,
                .owner = THIS_MODULE,
@@ -1307,12 +1306,12 @@ static struct of_platform_driver m8xx_pcmcia_driver = {
 
 static int __init m8xx_init(void)
 {
-       return of_register_platform_driver(&m8xx_pcmcia_driver);
+       return platform_driver_register(&m8xx_pcmcia_driver);
 }
 
 static void __exit m8xx_exit(void)
 {
-       of_unregister_platform_driver(&m8xx_pcmcia_driver);
+       platform_driver_unregister(&m8xx_pcmcia_driver);
 }
 
 module_init(m8xx_init);
index dfcdf0901d21e74ec4995d7b957fba2675a00537..2b952c654b1425d6792578bec4dea83d09dbbdb8 100644 (file)
@@ -268,8 +268,7 @@ static const struct rtc_class_ops mpc5121_rtc_ops = {
        .update_irq_enable = mpc5121_rtc_update_irq_enable,
 };
 
-static int __devinit mpc5121_rtc_probe(struct platform_device *op,
-                                       const struct of_device_id *match)
+static int __devinit mpc5121_rtc_probe(struct platform_device *op)
 {
        struct mpc5121_rtc_data *rtc;
        int err = 0;
@@ -364,7 +363,7 @@ static struct of_device_id mpc5121_rtc_match[] __devinitdata = {
        {},
 };
 
-static struct of_platform_driver mpc5121_rtc_driver = {
+static struct platform_driver mpc5121_rtc_driver = {
        .driver = {
                .name = "mpc5121-rtc",
                .owner = THIS_MODULE,
@@ -376,13 +375,13 @@ static struct of_platform_driver mpc5121_rtc_driver = {
 
 static int __init mpc5121_rtc_init(void)
 {
-       return of_register_platform_driver(&mpc5121_rtc_driver);
+       return platform_driver_register(&mpc5121_rtc_driver);
 }
 module_init(mpc5121_rtc_init);
 
 static void __exit mpc5121_rtc_exit(void)
 {
-       of_unregister_platform_driver(&mpc5121_rtc_driver);
+       platform_driver_unregister(&mpc5121_rtc_driver);
 }
 module_exit(mpc5121_rtc_exit);
 
index eca855a55c0d6abf96096e6b41847c93b06675db..45db1d570df1db61b3793f6bfa566aa0fe87f34b 100644 (file)
@@ -528,8 +528,7 @@ static const struct file_operations cpwd_fops = {
        .llseek =               no_llseek,
 };
 
-static int __devinit cpwd_probe(struct platform_device *op,
-                               const struct of_device_id *match)
+static int __devinit cpwd_probe(struct platform_device *op)
 {
        struct device_node *options;
        const char *str_prop;
@@ -678,7 +677,7 @@ static const struct of_device_id cpwd_match[] = {
 };
 MODULE_DEVICE_TABLE(of, cpwd_match);
 
-static struct of_platform_driver cpwd_driver = {
+static struct platform_driver cpwd_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -690,12 +689,12 @@ static struct of_platform_driver cpwd_driver = {
 
 static int __init cpwd_init(void)
 {
-       return of_register_platform_driver(&cpwd_driver);
+       return platform_driver_register(&cpwd_driver);
 }
 
 static void __exit cpwd_exit(void)
 {
-       of_unregister_platform_driver(&cpwd_driver);
+       platform_driver_unregister(&cpwd_driver);
 }
 
 module_init(cpwd_init);
index f6bd6f10fcece63c04aa106ca84b54f8684c7896..29a7cd4b90c839cdb8986dee2bc526a15a07f733 100644 (file)
@@ -261,8 +261,7 @@ static struct miscdevice gef_wdt_miscdev = {
 };
 
 
-static int __devinit gef_wdt_probe(struct platform_device *dev,
-       const struct of_device_id *match)
+static int __devinit gef_wdt_probe(struct platform_device *dev)
 {
        int timeout = 10;
        u32 freq;
@@ -303,7 +302,7 @@ static const struct of_device_id gef_wdt_ids[] = {
        {},
 };
 
-static struct of_platform_driver gef_wdt_driver = {
+static struct platform_driver gef_wdt_driver = {
        .driver = {
                .name = "gef_wdt",
                .owner = THIS_MODULE,
@@ -315,12 +314,12 @@ static struct of_platform_driver gef_wdt_driver = {
 static int __init gef_wdt_init(void)
 {
        printk(KERN_INFO "GE watchdog driver\n");
-       return of_register_platform_driver(&gef_wdt_driver);
+       return platform_driver_register(&gef_wdt_driver);
 }
 
 static void __exit gef_wdt_exit(void)
 {
-       of_unregister_platform_driver(&gef_wdt_driver);
+       platform_driver_unregister(&gef_wdt_driver);
 }
 
 module_init(gef_wdt_init);
index 8fa213cdb499b0c7e36460c6aa0af09cb1614254..ea438ad530559c401cba603e970a5564234c9092 100644 (file)
@@ -185,15 +185,18 @@ static struct miscdevice mpc8xxx_wdt_miscdev = {
        .fops   = &mpc8xxx_wdt_fops,
 };
 
-static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev,
-                                      const struct of_device_id *match)
+static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev)
 {
        int ret;
        struct device_node *np = ofdev->dev.of_node;
-       struct mpc8xxx_wdt_type *wdt_type = match->data;
+       struct mpc8xxx_wdt_type *wdt_type;
        u32 freq = fsl_get_sys_freq();
        bool enabled;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+       wdt_type = match->data;
+
        if (!freq || freq == -1)
                return -EINVAL;
 
@@ -272,7 +275,7 @@ static const struct of_device_id mpc8xxx_wdt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match);
 
-static struct of_platform_driver mpc8xxx_wdt_driver = {
+static struct platform_driver mpc8xxx_wdt_driver = {
        .probe          = mpc8xxx_wdt_probe,
        .remove         = __devexit_p(mpc8xxx_wdt_remove),
        .driver = {
@@ -308,13 +311,13 @@ module_init(mpc8xxx_wdt_init_late);
 
 static int __init mpc8xxx_wdt_init(void)
 {
-       return of_register_platform_driver(&mpc8xxx_wdt_driver);
+       return platform_driver_register(&mpc8xxx_wdt_driver);
 }
 arch_initcall(mpc8xxx_wdt_init);
 
 static void __exit mpc8xxx_wdt_exit(void)
 {
-       of_unregister_platform_driver(&mpc8xxx_wdt_driver);
+       platform_driver_unregister(&mpc8xxx_wdt_driver);
 }
 module_exit(mpc8xxx_wdt_exit);
 
index 3faee1ae64bd82dda8ebc618250f84e9f3b0c9f8..109b533896b70c0c5e81b3e983dbdb783d10821d 100644 (file)
@@ -172,8 +172,7 @@ static struct miscdevice riowd_miscdev = {
        .fops   = &riowd_fops
 };
 
-static int __devinit riowd_probe(struct platform_device *op,
-                                const struct of_device_id *match)
+static int __devinit riowd_probe(struct platform_device *op)
 {
        struct riowd *p;
        int err = -EINVAL;
@@ -238,7 +237,7 @@ static const struct of_device_id riowd_match[] = {
 };
 MODULE_DEVICE_TABLE(of, riowd_match);
 
-static struct of_platform_driver riowd_driver = {
+static struct platform_driver riowd_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -250,12 +249,12 @@ static struct of_platform_driver riowd_driver = {
 
 static int __init riowd_init(void)
 {
-       return of_register_platform_driver(&riowd_driver);
+       return platform_driver_register(&riowd_driver);
 }
 
 static void __exit riowd_exit(void)
 {
-       of_unregister_platform_driver(&riowd_driver);
+       platform_driver_unregister(&riowd_driver);
 }
 
 module_init(riowd_init);