Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Mar 2011 00:28:10 +0000 (17:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Mar 2011 00:28:10 +0000 (17:28 -0700)
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits)
  tty: serial: altera_jtaguart: Add device tree support
  tty: serial: altera_uart: Add devicetree support
  dt: eliminate of_platform_driver shim code
  dt: Eliminate of_platform_{,un}register_driver
  dt/serial: Eliminate users of of_platform_{,un}register_driver
  dt/usb: Eliminate users of of_platform_{,un}register_driver
  dt/video: Eliminate users of of_platform_{,un}register_driver
  dt/net: Eliminate users of of_platform_{,un}register_driver
  dt/sound: Eliminate users of of_platform_{,un}register_driver
  dt/spi: Eliminate users of of_platform_{,un}register_driver
  dt: uartlite: merge platform and of_platform driver bindings
  dt: xilinx_hwicap: merge platform and of_platform driver bindings
  ipmi: convert OF driver to platform driver
  leds/leds-gpio: merge platform_driver with of_platform_driver
  dt/sparc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: move of_bus_type infrastructure to ibmebus
  drivercore/dt: add a match table pointer to struct device
  dt: Typo fix.
  altera_ps2: Add devicetree support
  ...

178 files changed:
Documentation/devicetree/bindings/serial/altera_jtaguart.txt [new file with mode: 0644]
Documentation/devicetree/bindings/serial/altera_uart.txt [new file with mode: 0644]
Documentation/devicetree/bindings/serio/altera_ps2.txt [new file with mode: 0644]
arch/microblaze/pci/pci_32.c
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/include/asm/pci.h
arch/powerpc/kernel/ibmebus.c
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_32.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/pci_dn.c
arch/powerpc/kernel/pci_of_scan.c
arch/powerpc/platforms/52xx/mpc52xx_gpio.c
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
arch/powerpc/platforms/82xx/ep8248e.c
arch/powerpc/platforms/83xx/suspend.c
arch/powerpc/platforms/cell/axon_msi.c
arch/powerpc/platforms/pasemi/gpio_mdio.c
arch/powerpc/platforms/pseries/pci_dlpar.c
arch/powerpc/sysdev/axonram.c
arch/powerpc/sysdev/bestcomm/bestcomm.c
arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
arch/powerpc/sysdev/fsl_msi.c
arch/powerpc/sysdev/fsl_pmc.c
arch/powerpc/sysdev/fsl_rio.c
arch/powerpc/sysdev/pmi.c
arch/powerpc/sysdev/qe_lib/qe.c
arch/sparc/include/asm/parport.h
arch/sparc/kernel/apc.c
arch/sparc/kernel/auxio_64.c
arch/sparc/kernel/central.c
arch/sparc/kernel/chmc.c
arch/sparc/kernel/pci_fire.c
arch/sparc/kernel/pci_psycho.c
arch/sparc/kernel/pci_sabre.c
arch/sparc/kernel/pci_schizo.c
arch/sparc/kernel/pci_sun4v.c
arch/sparc/kernel/pmc.c
arch/sparc/kernel/power.c
arch/sparc/kernel/time_32.c
arch/sparc/kernel/time_64.c
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/char/hw_random/n2-drv.c
drivers/char/hw_random/pasemi-rng.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/xilinx_hwicap/xilinx_hwicap.c
drivers/crypto/amcc/crypto4xx_core.c
drivers/crypto/n2_core.c
drivers/crypto/talitos.c
drivers/dma/fsldma.c
drivers/dma/mpc512x_dma.c
drivers/dma/ppc4xx/adma.c
drivers/edac/mpc85xx_edac.c
drivers/edac/ppc4xx_edac.c
drivers/hwmon/ultra45_env.c
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-mpc.c
drivers/input/misc/sparcspkr.c
drivers/input/serio/altera_ps2.c
drivers/input/serio/i8042-sparcio.h
drivers/input/serio/xilinx_ps2.c
drivers/leds/leds-gpio.c
drivers/macintosh/smu.c
drivers/macintosh/therm_pm72.c
drivers/macintosh/therm_windtunnel.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/net/can/mscan/mpc5xxx_can.c
drivers/net/can/sja1000/sja1000_of_platform.c
drivers/net/fec_mpc52xx.c
drivers/net/fec_mpc52xx.h
drivers/net/fec_mpc52xx_phy.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/mii-bitbang.c
drivers/net/fs_enet/mii-fec.c
drivers/net/fsl_pq_mdio.c
drivers/net/gianfar.c
drivers/net/greth.c
drivers/net/ibm_newemac/core.c
drivers/net/ibm_newemac/mal.c
drivers/net/ibm_newemac/rgmii.c
drivers/net/ibm_newemac/tah.c
drivers/net/ibm_newemac/zmii.c
drivers/net/ll_temac_main.c
drivers/net/myri_sbus.c
drivers/net/niu.c
drivers/net/phy/mdio-gpio.c
drivers/net/sunbmac.c
drivers/net/sunhme.c
drivers/net/sunlance.c
drivers/net/sunqe.c
drivers/net/ucc_geth.c
drivers/net/xilinx_emaclite.c
drivers/of/device.c
drivers/of/platform.c
drivers/parport/parport_sunbpp.c
drivers/pcmcia/electra_cf.c
drivers/pcmcia/m8xx_pcmcia.c
drivers/rtc/rtc-mpc5121.c
drivers/sbus/char/bbc_i2c.c
drivers/sbus/char/display7seg.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/uctrl.c
drivers/scsi/qlogicpti.c
drivers/scsi/sun_esp.c
drivers/spi/mpc512x_psc_spi.c
drivers/spi/mpc52xx_psc_spi.c
drivers/spi/mpc52xx_spi.c
drivers/spi/spi_fsl_espi.c
drivers/spi/spi_fsl_lib.c
drivers/spi/spi_fsl_lib.h
drivers/spi/spi_fsl_spi.c
drivers/spi/spi_ppc4xx.c
drivers/tty/serial/altera_jtaguart.c
drivers/tty/serial/altera_uart.c
drivers/tty/serial/apbuart.c
drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/tty/serial/mpc52xx_uart.c
drivers/tty/serial/of_serial.c
drivers/tty/serial/sunhv.c
drivers/tty/serial/sunsab.c
drivers/tty/serial/sunsu.c
drivers/tty/serial/sunzilog.c
drivers/tty/serial/uartlite.c
drivers/tty/serial/ucc_uart.c
drivers/usb/gadget/fsl_qe_udc.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-ppc-of.c
drivers/usb/host/ehci-xilinx-of.c
drivers/usb/host/fhci-hcd.c
drivers/usb/host/isp1760-if.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-ppc-of.c
drivers/video/bw2.c
drivers/video/cg14.c
drivers/video/cg3.c
drivers/video/cg6.c
drivers/video/ffb.c
drivers/video/fsl-diu-fb.c
drivers/video/leo.c
drivers/video/mb862xx/mb862xxfb.c
drivers/video/p9100.c
drivers/video/platinumfb.c
drivers/video/sunxvr1000.c
drivers/video/tcx.c
drivers/video/xilinxfb.c
drivers/watchdog/cpwd.c
drivers/watchdog/gef_wdt.c
drivers/watchdog/mpc8xxx_wdt.c
drivers/watchdog/riowd.c
include/linux/device.h
include/linux/of.h
include/linux/of_device.h
include/linux/of_platform.h
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/mpc5200_dma.c
sound/soc/fsl/mpc5200_psc_ac97.c
sound/soc/fsl/mpc5200_psc_i2s.c
sound/sparc/amd7930.c
sound/sparc/cs4231.c
sound/sparc/dbri.c

diff --git a/Documentation/devicetree/bindings/serial/altera_jtaguart.txt b/Documentation/devicetree/bindings/serial/altera_jtaguart.txt
new file mode 100644 (file)
index 0000000..c152f65
--- /dev/null
@@ -0,0 +1,4 @@
+Altera JTAG UART
+
+Required properties:
+- compatible : should be "ALTR,juart-1.0"
diff --git a/Documentation/devicetree/bindings/serial/altera_uart.txt b/Documentation/devicetree/bindings/serial/altera_uart.txt
new file mode 100644 (file)
index 0000000..71cae3f
--- /dev/null
@@ -0,0 +1,7 @@
+Altera UART
+
+Required properties:
+- compatible : should be "ALTR,uart-1.0"
+
+Optional properties:
+- clock-frequency : frequency of the clock input to the UART
diff --git a/Documentation/devicetree/bindings/serio/altera_ps2.txt b/Documentation/devicetree/bindings/serio/altera_ps2.txt
new file mode 100644 (file)
index 0000000..4d9eecc
--- /dev/null
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
index 3c3d808d7ce08529def87f83738e52666893f559..92728a6cfd80c8a95b0ef1b2bf7dea10a5f25aed 100644 (file)
@@ -332,6 +332,7 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose)
                       hose->global_number);
                return;
        }
+       bus.dev->of_node = of_node_get(node);
        bus->secondary = hose->first_busno;
        hose->bus = bus;
 
index edeb80fdd2c3cc10ffea07ddf63e79586cf7995a..5e156e034fe29f18a9fc7cd3405ab550cc3ab091 100644 (file)
@@ -164,13 +164,13 @@ extern void setup_indirect_pci(struct pci_controller* hose,
                               resource_size_t cfg_addr,
                               resource_size_t cfg_data, u32 flags);
 
-#ifndef CONFIG_PPC64
-
 static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
 {
        return bus->sysdata;
 }
 
+#ifndef CONFIG_PPC64
+
 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
 {
        struct pci_controller *host;
@@ -228,19 +228,10 @@ extern void * update_dn_pci_info(struct device_node *dn, void *data);
 
 /* Get a device_node from a pci_dev.  This code must be fast except
  * in the case where the sysdata is incorrect and needs to be fixed
- * up (this will only happen once).
- * In this case the sysdata will have been inherited from a PCI host
- * bridge or a PCI-PCI bridge further up the tree, so it will point
- * to a valid struct pci_dn, just not the one we want.
- */
+ * up (this will only happen once). */
 static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
 {
-       struct device_node *dn = dev->sysdata;
-       struct pci_dn *pdn = dn->data;
-
-       if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number)
-               return dn;      /* fast path.  sysdata is good */
-       return fetch_dev_dn(dev);
+       return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev);
 }
 
 static inline int pci_device_from_OF_node(struct device_node *np,
@@ -258,7 +249,7 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
        if (bus->self)
                return pci_device_to_OF_node(bus->self);
        else
-               return bus->sysdata; /* Must be root bus (PHB) */
+               return bus->dev.of_node; /* Must be root bus (PHB) */
 }
 
 /** Find the bus corresponding to the indicated device node */
@@ -270,14 +261,6 @@ extern void pcibios_remove_pci_devices(struct pci_bus *bus);
 /** Discover new pci devices under this bus, and add them */
 extern void pcibios_add_pci_devices(struct pci_bus *bus);
 
-static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
-{
-       struct device_node *busdn = bus->sysdata;
-
-       BUG_ON(busdn == NULL);
-       return PCI_DN(busdn)->phb;
-}
-
 
 extern void isa_bridge_find_early(struct pci_controller *hose);
 
index a20a9ad2258b2c38a21064eb3df89109bbe9f110..7d7790954e02039f02ad71f1ac935b866eac7e4f 100644 (file)
@@ -201,7 +201,7 @@ extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
 extern void pcibios_setup_bus_devices(struct pci_bus *bus);
 extern void pcibios_setup_bus_self(struct pci_bus *bus);
 extern void pcibios_setup_phb_io_space(struct pci_controller *hose);
-extern void pcibios_scan_phb(struct pci_controller *hose, void *sysdata);
+extern void pcibios_scan_phb(struct pci_controller *hose);
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_POWERPC_PCI_H */
index f62efdfd176989c142019351fe691b52edc5260f..c00d4ca1ee157fc995629825b95af4b8b232a5bb 100644 (file)
@@ -201,13 +201,14 @@ int ibmebus_register_driver(struct of_platform_driver *drv)
        /* If the driver uses devices that ibmebus doesn't know, add them */
        ibmebus_create_devices(drv->driver.of_match_table);
 
-       return of_register_driver(drv, &ibmebus_bus_type);
+       drv->driver.bus = &ibmebus_bus_type;
+       return driver_register(&drv->driver);
 }
 EXPORT_SYMBOL(ibmebus_register_driver);
 
 void ibmebus_unregister_driver(struct of_platform_driver *drv)
 {
-       of_unregister_driver(drv);
+       driver_unregister(&drv->driver);
 }
 EXPORT_SYMBOL(ibmebus_unregister_driver);
 
@@ -308,15 +309,410 @@ static ssize_t ibmebus_store_remove(struct bus_type *bus,
        }
 }
 
+
 static struct bus_attribute ibmebus_bus_attrs[] = {
        __ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe),
        __ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove),
        __ATTR_NULL
 };
 
+static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv)
+{
+       const struct of_device_id *matches = drv->of_match_table;
+
+       if (!matches)
+               return 0;
+
+       return of_match_device(matches, dev) != NULL;
+}
+
+static int ibmebus_bus_device_probe(struct device *dev)
+{
+       int error = -ENODEV;
+       struct of_platform_driver *drv;
+       struct platform_device *of_dev;
+       const struct of_device_id *match;
+
+       drv = to_of_platform_driver(dev->driver);
+       of_dev = to_platform_device(dev);
+
+       if (!drv->probe)
+               return error;
+
+       of_dev_get(of_dev);
+
+       match = of_match_device(drv->driver.of_match_table, dev);
+       if (match)
+               error = drv->probe(of_dev, match);
+       if (error)
+               of_dev_put(of_dev);
+
+       return error;
+}
+
+static int ibmebus_bus_device_remove(struct device *dev)
+{
+       struct platform_device *of_dev = to_platform_device(dev);
+       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
+
+       if (dev->driver && drv->remove)
+               drv->remove(of_dev);
+       return 0;
+}
+
+static void ibmebus_bus_device_shutdown(struct device *dev)
+{
+       struct platform_device *of_dev = to_platform_device(dev);
+       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
+
+       if (dev->driver && drv->shutdown)
+               drv->shutdown(of_dev);
+}
+
+/*
+ * ibmebus_bus_device_attrs
+ */
+static ssize_t devspec_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct platform_device *ofdev;
+
+       ofdev = to_platform_device(dev);
+       return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
+}
+
+static ssize_t name_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct platform_device *ofdev;
+
+       ofdev = to_platform_device(dev);
+       return sprintf(buf, "%s\n", ofdev->dev.of_node->name);
+}
+
+static ssize_t modalias_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       ssize_t len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2);
+       buf[len] = '\n';
+       buf[len+1] = 0;
+       return len+1;
+}
+
+struct device_attribute ibmebus_bus_device_attrs[] = {
+       __ATTR_RO(devspec),
+       __ATTR_RO(name),
+       __ATTR_RO(modalias),
+       __ATTR_NULL
+};
+
+#ifdef CONFIG_PM_SLEEP
+static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg)
+{
+       struct platform_device *of_dev = to_platform_device(dev);
+       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
+       int ret = 0;
+
+       if (dev->driver && drv->suspend)
+               ret = drv->suspend(of_dev, mesg);
+       return ret;
+}
+
+static int ibmebus_bus_legacy_resume(struct device *dev)
+{
+       struct platform_device *of_dev = to_platform_device(dev);
+       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
+       int ret = 0;
+
+       if (dev->driver && drv->resume)
+               ret = drv->resume(of_dev);
+       return ret;
+}
+
+static int ibmebus_bus_pm_prepare(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (drv && drv->pm && drv->pm->prepare)
+               ret = drv->pm->prepare(dev);
+
+       return ret;
+}
+
+static void ibmebus_bus_pm_complete(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+
+       if (drv && drv->pm && drv->pm->complete)
+               drv->pm->complete(dev);
+}
+
+#ifdef CONFIG_SUSPEND
+
+static int ibmebus_bus_pm_suspend(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->suspend)
+                       ret = drv->pm->suspend(dev);
+       } else {
+               ret = ibmebus_bus_legacy_suspend(dev, PMSG_SUSPEND);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_suspend_noirq(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->suspend_noirq)
+                       ret = drv->pm->suspend_noirq(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_resume(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->resume)
+                       ret = drv->pm->resume(dev);
+       } else {
+               ret = ibmebus_bus_legacy_resume(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_resume_noirq(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->resume_noirq)
+                       ret = drv->pm->resume_noirq(dev);
+       }
+
+       return ret;
+}
+
+#else /* !CONFIG_SUSPEND */
+
+#define ibmebus_bus_pm_suspend         NULL
+#define ibmebus_bus_pm_resume          NULL
+#define ibmebus_bus_pm_suspend_noirq   NULL
+#define ibmebus_bus_pm_resume_noirq    NULL
+
+#endif /* !CONFIG_SUSPEND */
+
+#ifdef CONFIG_HIBERNATION
+
+static int ibmebus_bus_pm_freeze(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->freeze)
+                       ret = drv->pm->freeze(dev);
+       } else {
+               ret = ibmebus_bus_legacy_suspend(dev, PMSG_FREEZE);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_freeze_noirq(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->freeze_noirq)
+                       ret = drv->pm->freeze_noirq(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_thaw(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->thaw)
+                       ret = drv->pm->thaw(dev);
+       } else {
+               ret = ibmebus_bus_legacy_resume(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_thaw_noirq(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->thaw_noirq)
+                       ret = drv->pm->thaw_noirq(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_poweroff(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->poweroff)
+                       ret = drv->pm->poweroff(dev);
+       } else {
+               ret = ibmebus_bus_legacy_suspend(dev, PMSG_HIBERNATE);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_poweroff_noirq(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->poweroff_noirq)
+                       ret = drv->pm->poweroff_noirq(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_restore(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->restore)
+                       ret = drv->pm->restore(dev);
+       } else {
+               ret = ibmebus_bus_legacy_resume(dev);
+       }
+
+       return ret;
+}
+
+static int ibmebus_bus_pm_restore_noirq(struct device *dev)
+{
+       struct device_driver *drv = dev->driver;
+       int ret = 0;
+
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
+               if (drv->pm->restore_noirq)
+                       ret = drv->pm->restore_noirq(dev);
+       }
+
+       return ret;
+}
+
+#else /* !CONFIG_HIBERNATION */
+
+#define ibmebus_bus_pm_freeze          NULL
+#define ibmebus_bus_pm_thaw            NULL
+#define ibmebus_bus_pm_poweroff                NULL
+#define ibmebus_bus_pm_restore         NULL
+#define ibmebus_bus_pm_freeze_noirq    NULL
+#define ibmebus_bus_pm_thaw_noirq              NULL
+#define ibmebus_bus_pm_poweroff_noirq  NULL
+#define ibmebus_bus_pm_restore_noirq   NULL
+
+#endif /* !CONFIG_HIBERNATION */
+
+static struct dev_pm_ops ibmebus_bus_dev_pm_ops = {
+       .prepare = ibmebus_bus_pm_prepare,
+       .complete = ibmebus_bus_pm_complete,
+       .suspend = ibmebus_bus_pm_suspend,
+       .resume = ibmebus_bus_pm_resume,
+       .freeze = ibmebus_bus_pm_freeze,
+       .thaw = ibmebus_bus_pm_thaw,
+       .poweroff = ibmebus_bus_pm_poweroff,
+       .restore = ibmebus_bus_pm_restore,
+       .suspend_noirq = ibmebus_bus_pm_suspend_noirq,
+       .resume_noirq = ibmebus_bus_pm_resume_noirq,
+       .freeze_noirq = ibmebus_bus_pm_freeze_noirq,
+       .thaw_noirq = ibmebus_bus_pm_thaw_noirq,
+       .poweroff_noirq = ibmebus_bus_pm_poweroff_noirq,
+       .restore_noirq = ibmebus_bus_pm_restore_noirq,
+};
+
+#define IBMEBUS_BUS_PM_OPS_PTR (&ibmebus_bus_dev_pm_ops)
+
+#else /* !CONFIG_PM_SLEEP */
+
+#define IBMEBUS_BUS_PM_OPS_PTR NULL
+
+#endif /* !CONFIG_PM_SLEEP */
+
 struct bus_type ibmebus_bus_type = {
+       .name      = "ibmebus",
        .uevent    = of_device_uevent,
-       .bus_attrs = ibmebus_bus_attrs
+       .bus_attrs = ibmebus_bus_attrs,
+       .match     = ibmebus_bus_bus_match,
+       .probe     = ibmebus_bus_device_probe,
+       .remove    = ibmebus_bus_device_remove,
+       .shutdown  = ibmebus_bus_device_shutdown,
+       .dev_attrs = ibmebus_bus_device_attrs,
+       .pm        = IBMEBUS_BUS_PM_OPS_PTR,
 };
 EXPORT_SYMBOL(ibmebus_bus_type);
 
@@ -326,7 +722,7 @@ static int __init ibmebus_bus_init(void)
 
        printk(KERN_INFO "IBM eBus Device Driver\n");
 
-       err = of_bus_type_init(&ibmebus_bus_type, "ibmebus");
+       err = bus_register(&ibmebus_bus_type);
        if (err) {
                printk(KERN_ERR "%s: failed to register IBM eBus.\n",
                       __func__);
index b2c363ef38ad7dce344c9058abdad4563e911b21..24582181b6ec36d691ec2df451f132dedaf1a769 100644 (file)
@@ -36,8 +36,7 @@
  * lacking some bits needed here.
  */
 
-static int __devinit of_pci_phb_probe(struct platform_device *dev,
-                                     const struct of_device_id *match)
+static int __devinit of_pci_phb_probe(struct platform_device *dev)
 {
        struct pci_controller *phb;
 
@@ -74,7 +73,7 @@ static int __devinit of_pci_phb_probe(struct platform_device *dev,
 #endif /* CONFIG_EEH */
 
        /* Scan the bus */
-       pcibios_scan_phb(phb, dev->dev.of_node);
+       pcibios_scan_phb(phb);
        if (phb->bus == NULL)
                return -ENXIO;
 
@@ -104,7 +103,7 @@ static struct of_device_id of_pci_phb_ids[] = {
        {}
 };
 
-static struct of_platform_driver of_pci_phb_driver = {
+static struct platform_driver of_pci_phb_driver = {
        .probe = of_pci_phb_probe,
        .driver = {
                .name = "of-pci",
@@ -115,7 +114,7 @@ static struct of_platform_driver of_pci_phb_driver = {
 
 static __init int of_pci_phb_init(void)
 {
-       return of_register_platform_driver(&of_pci_phb_driver);
+       return platform_driver_register(&of_pci_phb_driver);
 }
 
 device_initcall(of_pci_phb_init);
index eb341be9a4d934505017e5e96af994b51076a91f..3cd85faa8ac66e3c251a98805d789060dbffce2d 100644 (file)
@@ -1688,13 +1688,8 @@ int early_find_capability(struct pci_controller *hose, int bus, int devfn,
 /**
  * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus
  * @hose: Pointer to the PCI host controller instance structure
- * @sysdata: value to use for sysdata pointer.  ppc32 and ppc64 differ here
- *
- * Note: the 'data' pointer is a temporary measure.  As 32 and 64 bit
- * pci code gets merged, this parameter should become unnecessary because
- * both will use the same value.
  */
-void __devinit pcibios_scan_phb(struct pci_controller *hose, void *sysdata)
+void __devinit pcibios_scan_phb(struct pci_controller *hose)
 {
        struct pci_bus *bus;
        struct device_node *node = hose->dn;
@@ -1704,13 +1699,13 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose, void *sysdata)
                 node ? node->full_name : "<NO NAME>");
 
        /* Create an empty bus for the toplevel */
-       bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops,
-                            sysdata);
+       bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, hose);
        if (bus == NULL) {
                pr_err("Failed to create bus for PCI domain %04x\n",
                        hose->global_number);
                return;
        }
+       bus->dev.of_node = of_node_get(node);
        bus->secondary = hose->first_busno;
        hose->bus = bus;
 
index e7db5b48004ab43e30de96e2ac79d93a11b5fd6b..bedb370459f2604f185bea39f8833a296c5e5a00 100644 (file)
@@ -381,7 +381,7 @@ static int __init pcibios_init(void)
                if (pci_assign_all_buses)
                        hose->first_busno = next_busno;
                hose->last_busno = 0xff;
-               pcibios_scan_phb(hose, hose);
+               pcibios_scan_phb(hose);
                pci_bus_add_devices(hose->bus);
                if (pci_assign_all_buses || next_busno <= hose->last_busno)
                        next_busno = hose->last_busno + pcibios_assign_bus_offset;
index 851577608a783ddff85726914eed20b0515c5fae..fc6452b6be9fa7e71153d9ea7bbbe48099a476d1 100644 (file)
@@ -64,7 +64,7 @@ static int __init pcibios_init(void)
 
        /* Scan all of the recorded PCI controllers.  */
        list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
-               pcibios_scan_phb(hose, hose->dn);
+               pcibios_scan_phb(hose);
                pci_bus_add_devices(hose->bus);
        }
 
@@ -242,10 +242,10 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
                        break;
                bus = NULL;
        }
-       if (bus == NULL || bus->sysdata == NULL)
+       if (bus == NULL || bus->dev.of_node == NULL)
                return -ENODEV;
 
-       hose_node = (struct device_node *)bus->sysdata;
+       hose_node = bus->dev.of_node;
        hose = PCI_DN(hose_node)->phb;
 
        switch (which) {
index d56b35ee7f74f04af5290aa10937f2e323e1cc6d..29852688ceaaae7f6f9c09cbc7e3f6350ee8170f 100644 (file)
@@ -161,7 +161,7 @@ static void *is_devfn_node(struct device_node *dn, void *data)
 /*
  * This is the "slow" path for looking up a device_node from a
  * pci_dev.  It will hunt for the device under its parent's
- * phb and then update sysdata for a future fastpath.
+ * phb and then update of_node pointer.
  *
  * It may also do fixups on the actual device since this happens
  * on the first read/write.
@@ -170,16 +170,19 @@ static void *is_devfn_node(struct device_node *dn, void *data)
  * In this case it may probe for real hardware ("just in case")
  * and add a device_node to the device tree if necessary.
  *
+ * Is this function necessary anymore now that dev->dev.of_node is
+ * used to store the node pointer?
+ *
  */
 struct device_node *fetch_dev_dn(struct pci_dev *dev)
 {
-       struct device_node *orig_dn = dev->sysdata;
+       struct device_node *orig_dn = dev->dev.of_node;
        struct device_node *dn;
        unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
 
        dn = traverse_pci_devices(orig_dn, is_devfn_node, (void *)searchval);
        if (dn)
-               dev->sysdata = dn;
+               dev->dev.of_node = dn;
        return dn;
 }
 EXPORT_SYMBOL(fetch_dev_dn);
index e751506323b4509bf04abefb266a6435173a307f..1e89a72fd0301d744f36e2f0db8cb6cb320f9620 100644 (file)
@@ -135,7 +135,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
        pr_debug("    create device, devfn: %x, type: %s\n", devfn, type);
 
        dev->bus = bus;
-       dev->sysdata = node;
+       dev->dev.of_node = of_node_get(node);
        dev->dev.parent = bus->bridge;
        dev->dev.bus = &pci_bus_type;
        dev->devfn = devfn;
@@ -238,7 +238,7 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
        bus->primary = dev->bus->number;
        bus->subordinate = busrange[1];
        bus->bridge_ctl = 0;
-       bus->sysdata = node;
+       bus->dev.of_node = of_node_get(node);
 
        /* parse ranges property */
        /* PCI #address-cells == 3 and #size-cells == 2 always */
index 0dad9a935eb5f1f34d57c134c7441c3d26dfacdf..1757d1db4b51a07c2dd12c066ae680ea1ba6d82c 100644 (file)
@@ -147,8 +147,7 @@ mpc52xx_wkup_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
        return 0;
 }
 
-static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *match)
+static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev)
 {
        struct mpc52xx_gpiochip *chip;
        struct mpc52xx_gpio_wkup __iomem *regs;
@@ -191,7 +190,7 @@ static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = {
        {}
 };
 
-static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = {
+static struct platform_driver mpc52xx_wkup_gpiochip_driver = {
        .driver = {
                .name = "gpio_wkup",
                .owner = THIS_MODULE,
@@ -310,8 +309,7 @@ mpc52xx_simple_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
        return 0;
 }
 
-static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *match)
+static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev)
 {
        struct mpc52xx_gpiochip *chip;
        struct gpio_chip *gc;
@@ -349,7 +347,7 @@ static const struct of_device_id mpc52xx_simple_gpiochip_match[] = {
        {}
 };
 
-static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
+static struct platform_driver mpc52xx_simple_gpiochip_driver = {
        .driver = {
                .name = "gpio",
                .owner = THIS_MODULE,
@@ -361,10 +359,10 @@ static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
 
 static int __init mpc52xx_gpio_init(void)
 {
-       if (of_register_platform_driver(&mpc52xx_wkup_gpiochip_driver))
+       if (platform_driver_register(&mpc52xx_wkup_gpiochip_driver))
                printk(KERN_ERR "Unable to register wakeup GPIO driver\n");
 
-       if (of_register_platform_driver(&mpc52xx_simple_gpiochip_driver))
+       if (platform_driver_register(&mpc52xx_simple_gpiochip_driver))
                printk(KERN_ERR "Unable to register simple GPIO driver\n");
 
        return 0;
index e0d703c7fdf7cc3e7d1491a963db90ad4735b9e4..859abf1c6d4bf8b32b90da11021075798ce2fc88 100644 (file)
@@ -721,8 +721,7 @@ static inline int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,
 /* ---------------------------------------------------------------------
  * of_platform bus binding code
  */
-static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev,
-                                      const struct of_device_id *match)
+static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev)
 {
        struct mpc52xx_gpt_priv *gpt;
 
@@ -781,7 +780,7 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
        {}
 };
 
-static struct of_platform_driver mpc52xx_gpt_driver = {
+static struct platform_driver mpc52xx_gpt_driver = {
        .driver = {
                .name = "mpc52xx-gpt",
                .owner = THIS_MODULE,
@@ -793,10 +792,7 @@ static struct of_platform_driver mpc52xx_gpt_driver = {
 
 static int __init mpc52xx_gpt_init(void)
 {
-       if (of_register_platform_driver(&mpc52xx_gpt_driver))
-               pr_err("error registering MPC52xx GPT driver\n");
-
-       return 0;
+       return platform_driver_register(&mpc52xx_gpt_driver);
 }
 
 /* Make sure GPIOs and IRQs get set up before anyone tries to use them */
index f4ac213c89c0b4fa190e7731813d3be40e44b9a3..6385d883cb8dec749b95e03ac51dff0201f01b52 100644 (file)
@@ -436,8 +436,7 @@ void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req)
 }
 EXPORT_SYMBOL(mpc52xx_lpbfifo_abort);
 
-static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op,
-                                          const struct of_device_id *match)
+static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op)
 {
        struct resource res;
        int rc = -ENOMEM;
@@ -536,7 +535,7 @@ static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = {
        {},
 };
 
-static struct of_platform_driver mpc52xx_lpbfifo_driver = {
+static struct platform_driver mpc52xx_lpbfifo_driver = {
        .driver = {
                .name = "mpc52xx-lpbfifo",
                .owner = THIS_MODULE,
@@ -551,14 +550,12 @@ static struct of_platform_driver mpc52xx_lpbfifo_driver = {
  */
 static int __init mpc52xx_lpbfifo_init(void)
 {
-       pr_debug("Registering LocalPlus bus FIFO driver\n");
-       return of_register_platform_driver(&mpc52xx_lpbfifo_driver);
+       return platform_driver_register(&mpc52xx_lpbfifo_driver);
 }
 module_init(mpc52xx_lpbfifo_init);
 
 static void __exit mpc52xx_lpbfifo_exit(void)
 {
-       pr_debug("Unregistering LocalPlus bus FIFO driver\n");
-       of_unregister_platform_driver(&mpc52xx_lpbfifo_driver);
+       platform_driver_unregister(&mpc52xx_lpbfifo_driver);
 }
 module_exit(mpc52xx_lpbfifo_exit);
index 1565e0446dc822b2e3036e86077a0311f93d2cb3..10ff526cd0467a6ecee78acc30e1d1350922c2e5 100644 (file)
@@ -111,8 +111,7 @@ static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
        .ops = &ep8248e_mdio_ops,
 };
 
-static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev,
-                                        const struct of_device_id *match)
+static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev)
 {
        struct mii_bus *bus;
        struct resource res;
@@ -167,7 +166,7 @@ static const struct of_device_id ep8248e_mdio_match[] = {
        {},
 };
 
-static struct of_platform_driver ep8248e_mdio_driver = {
+static struct platform_driver ep8248e_mdio_driver = {
        .driver = {
                .name = "ep8248e-mdio-bitbang",
                .owner = THIS_MODULE,
@@ -308,7 +307,7 @@ static  __initdata struct of_device_id of_bus_ids[] = {
 static int __init declare_of_platform_devices(void)
 {
        of_platform_bus_probe(NULL, of_bus_ids, NULL);
-       of_register_platform_driver(&ep8248e_mdio_driver);
+       platform_driver_register(&ep8248e_mdio_driver);
 
        return 0;
 }
index fd4f2f2f19e65e6cd59b087b5889847d60850380..188272934cfb3c6818754dae0260216b5c4ccb65 100644 (file)
@@ -318,14 +318,18 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
        .end = mpc83xx_suspend_end,
 };
 
-static int pmc_probe(struct platform_device *ofdev,
-                     const struct of_device_id *match)
+static int pmc_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct resource res;
-       struct pmc_type *type = match->data;
+       struct pmc_type *type;
        int ret = 0;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+
+       type = ofdev->dev.of_match->data;
+
        if (!of_device_is_available(np))
                return -ENODEV;
 
@@ -422,7 +426,7 @@ static struct of_device_id pmc_match[] = {
        {}
 };
 
-static struct of_platform_driver pmc_driver = {
+static struct platform_driver pmc_driver = {
        .driver = {
                .name = "mpc83xx-pmc",
                .owner = THIS_MODULE,
@@ -434,7 +438,7 @@ static struct of_platform_driver pmc_driver = {
 
 static int pmc_init(void)
 {
-       return of_register_platform_driver(&pmc_driver);
+       return platform_driver_register(&pmc_driver);
 }
 
 module_init(pmc_init);
index e3e379c6caa79c6a423707d21b1e08face564534..c35099af340e868f9ba7416a7e57b082bcd08fe3 100644 (file)
@@ -328,7 +328,7 @@ static struct irq_host_ops msic_host_ops = {
        .map    = msic_host_map,
 };
 
-static int axon_msi_shutdown(struct platform_device *device)
+static void axon_msi_shutdown(struct platform_device *device)
 {
        struct axon_msic *msic = dev_get_drvdata(&device->dev);
        u32 tmp;
@@ -338,12 +338,9 @@ static int axon_msi_shutdown(struct platform_device *device)
        tmp  = dcr_read(msic->dcr_host, MSIC_CTRL_REG);
        tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
        msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
-
-       return 0;
 }
 
-static int axon_msi_probe(struct platform_device *device,
-                         const struct of_device_id *device_id)
+static int axon_msi_probe(struct platform_device *device)
 {
        struct device_node *dn = device->dev.of_node;
        struct axon_msic *msic;
@@ -446,7 +443,7 @@ static const struct of_device_id axon_msi_device_id[] = {
        {}
 };
 
-static struct of_platform_driver axon_msi_driver = {
+static struct platform_driver axon_msi_driver = {
        .probe          = axon_msi_probe,
        .shutdown       = axon_msi_shutdown,
        .driver = {
@@ -458,7 +455,7 @@ static struct of_platform_driver axon_msi_driver = {
 
 static int __init axon_msi_init(void)
 {
-       return of_register_platform_driver(&axon_msi_driver);
+       return platform_driver_register(&axon_msi_driver);
 }
 subsys_initcall(axon_msi_init);
 
index a5d907b5a4c2f0911bd5e3fe7d76dfaf139d9062..9886296e08dac7d32ad0bdf89f8911a3cf134720 100644 (file)
@@ -216,8 +216,7 @@ static int gpio_mdio_reset(struct mii_bus *bus)
 }
 
 
-static int __devinit gpio_mdio_probe(struct platform_device *ofdev,
-                                    const struct of_device_id *match)
+static int __devinit gpio_mdio_probe(struct platform_device *ofdev)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
@@ -299,7 +298,7 @@ static struct of_device_id gpio_mdio_match[] =
 };
 MODULE_DEVICE_TABLE(of, gpio_mdio_match);
 
-static struct of_platform_driver gpio_mdio_driver =
+static struct platform_driver gpio_mdio_driver =
 {
        .probe          = gpio_mdio_probe,
        .remove         = gpio_mdio_remove,
@@ -326,13 +325,13 @@ int gpio_mdio_init(void)
        if (!gpio_regs)
                return -ENODEV;
 
-       return of_register_platform_driver(&gpio_mdio_driver);
+       return platform_driver_register(&gpio_mdio_driver);
 }
 module_init(gpio_mdio_init);
 
 void gpio_mdio_exit(void)
 {
-       of_unregister_platform_driver(&gpio_mdio_driver);
+       platform_driver_unregister(&gpio_mdio_driver);
        if (gpio_regs)
                iounmap(gpio_regs);
 }
index 5fcc92a12d3e1256b1c5d648b624f4791e3b0817..3bf4488aaec6537ce6983965bee978209fb7be4e 100644 (file)
@@ -149,7 +149,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
        if (dn->child)
                eeh_add_device_tree_early(dn);
 
-       pcibios_scan_phb(phb, dn);
+       pcibios_scan_phb(phb);
        pcibios_finish_adding_to_bus(phb->bus);
 
        return phb;
index 2659a60bd7b864503ae2ab39b83fd991f5d90357..27402c7d309d8973dc8915f537a400ba45f2e9f9 100644 (file)
@@ -172,10 +172,9 @@ static const struct block_device_operations axon_ram_devops = {
 
 /**
  * axon_ram_probe - probe() method for platform driver
- * @device, @device_id: see of_platform_driver method
+ * @device: see platform_driver method
  */
-static int axon_ram_probe(struct platform_device *device,
-                         const struct of_device_id *device_id)
+static int axon_ram_probe(struct platform_device *device)
 {
        static int axon_ram_bank_id = -1;
        struct axon_ram_bank *bank;
@@ -326,7 +325,7 @@ static struct of_device_id axon_ram_device_id[] = {
        {}
 };
 
-static struct of_platform_driver axon_ram_driver = {
+static struct platform_driver axon_ram_driver = {
        .probe          = axon_ram_probe,
        .remove         = axon_ram_remove,
        .driver = {
@@ -350,7 +349,7 @@ axon_ram_init(void)
        }
        azfs_minor = 0;
 
-       return of_register_platform_driver(&axon_ram_driver);
+       return platform_driver_register(&axon_ram_driver);
 }
 
 /**
@@ -359,7 +358,7 @@ axon_ram_init(void)
 static void __exit
 axon_ram_exit(void)
 {
-       of_unregister_platform_driver(&axon_ram_driver);
+       platform_driver_unregister(&axon_ram_driver);
        unregister_blkdev(azfs_major, AXON_RAM_DEVICE_NAME);
 }
 
index 65025611506495447386e214112f3bf03e166599..b3fbb271be875efa2e513fffa6314add3db0dd04 100644 (file)
@@ -365,8 +365,7 @@ bcom_engine_cleanup(void)
 /* OF platform driver                                                       */
 /* ======================================================================== */
 
-static int __devinit mpc52xx_bcom_probe(struct platform_device *op,
-                                       const struct of_device_id *match)
+static int __devinit mpc52xx_bcom_probe(struct platform_device *op)
 {
        struct device_node *ofn_sram;
        struct resource res_bcom;
@@ -492,7 +491,7 @@ static struct of_device_id mpc52xx_bcom_of_match[] = {
 MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match);
 
 
-static struct of_platform_driver mpc52xx_bcom_of_platform_driver = {
+static struct platform_driver mpc52xx_bcom_of_platform_driver = {
        .probe          = mpc52xx_bcom_probe,
        .remove         = mpc52xx_bcom_remove,
        .driver = {
@@ -510,13 +509,13 @@ static struct of_platform_driver mpc52xx_bcom_of_platform_driver = {
 static int __init
 mpc52xx_bcom_init(void)
 {
-       return of_register_platform_driver(&mpc52xx_bcom_of_platform_driver);
+       return platform_driver_register(&mpc52xx_bcom_of_platform_driver);
 }
 
 static void __exit
 mpc52xx_bcom_exit(void)
 {
-       of_unregister_platform_driver(&mpc52xx_bcom_of_platform_driver);
+       platform_driver_unregister(&mpc52xx_bcom_of_platform_driver);
 }
 
 /* If we're not a module, we must make sure everything is setup before  */
index cc8d6556d7991cca14e303aaf0eee844dcb4adb6..2b9f0c925326d115b25f879ce9087b2893c5527b 100644 (file)
@@ -71,8 +71,7 @@ static int __init get_offset_from_cmdline(char *str)
 __setup("cache-sram-size=", get_size_from_cmdline);
 __setup("cache-sram-offset=", get_offset_from_cmdline);
 
-static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev,
-                                         const struct of_device_id *match)
+static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev)
 {
        long rval;
        unsigned int rem;
@@ -204,7 +203,7 @@ static struct of_device_id mpc85xx_l2ctlr_of_match[] = {
        {},
 };
 
-static struct of_platform_driver mpc85xx_l2ctlr_of_platform_driver = {
+static struct platform_driver mpc85xx_l2ctlr_of_platform_driver = {
        .driver = {
                .name           = "fsl-l2ctlr",
                .owner          = THIS_MODULE,
@@ -216,12 +215,12 @@ static struct of_platform_driver mpc85xx_l2ctlr_of_platform_driver = {
 
 static __init int mpc85xx_l2ctlr_of_init(void)
 {
-       return of_register_platform_driver(&mpc85xx_l2ctlr_of_platform_driver);
+       return platform_driver_register(&mpc85xx_l2ctlr_of_platform_driver);
 }
 
 static void __exit mpc85xx_l2ctlr_of_exit(void)
 {
-       of_unregister_platform_driver(&mpc85xx_l2ctlr_of_platform_driver);
+       platform_driver_unregister(&mpc85xx_l2ctlr_of_platform_driver);
 }
 
 subsys_initcall(mpc85xx_l2ctlr_of_init);
index 108d76fa8f1c997f566a1a3448402ce9e55d3bae..ee6a8a52ac716b0f6e74dae2e1e0963a1435817f 100644 (file)
@@ -273,8 +273,7 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
        return 0;
 }
 
-static int __devinit fsl_of_msi_probe(struct platform_device *dev,
-                               const struct of_device_id *match)
+static int __devinit fsl_of_msi_probe(struct platform_device *dev)
 {
        struct fsl_msi *msi;
        struct resource res;
@@ -282,11 +281,15 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev,
        int rc;
        int virt_msir;
        const u32 *p;
-       struct fsl_msi_feature *features = match->data;
+       struct fsl_msi_feature *features;
        struct fsl_msi_cascade_data *cascade_data = NULL;
        int len;
        u32 offset;
 
+       if (!dev->dev.of_match)
+               return -EINVAL;
+       features = dev->dev.of_match->data;
+
        printk(KERN_DEBUG "Setting up Freescale MSI support\n");
 
        msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL);
@@ -411,7 +414,7 @@ static const struct of_device_id fsl_of_msi_ids[] = {
        {}
 };
 
-static struct of_platform_driver fsl_of_msi_driver = {
+static struct platform_driver fsl_of_msi_driver = {
        .driver = {
                .name = "fsl-msi",
                .owner = THIS_MODULE,
@@ -423,7 +426,7 @@ static struct of_platform_driver fsl_of_msi_driver = {
 
 static __init int fsl_of_msi_init(void)
 {
-       return of_register_platform_driver(&fsl_of_msi_driver);
+       return platform_driver_register(&fsl_of_msi_driver);
 }
 
 subsys_initcall(fsl_of_msi_init);
index e9381bfefb2165d3dac308ed38d74c6540abac8f..f122e8961d32282676179fda517038c38b001126 100644 (file)
@@ -58,8 +58,7 @@ static const struct platform_suspend_ops pmc_suspend_ops = {
        .enter = pmc_suspend_enter,
 };
 
-static int pmc_probe(struct platform_device *ofdev,
-                    const struct of_device_id *id)
+static int pmc_probe(struct platform_device *ofdev)
 {
        pmc_regs = of_iomap(ofdev->dev.of_node, 0);
        if (!pmc_regs)
@@ -76,7 +75,7 @@ static const struct of_device_id pmc_ids[] = {
        { },
 };
 
-static struct of_platform_driver pmc_driver = {
+static struct platform_driver pmc_driver = {
        .driver = {
                .name = "fsl-pmc",
                .owner = THIS_MODULE,
@@ -87,6 +86,6 @@ static struct of_platform_driver pmc_driver = {
 
 static int __init pmc_init(void)
 {
-       return of_register_platform_driver(&pmc_driver);
+       return platform_driver_register(&pmc_driver);
 }
 device_initcall(pmc_init);
index 8c6cab0132783634b76183d521b19ebe8d31a941..3eff2c3a9ad56877d9e159ffa8ce460917d6bf5e 100644 (file)
@@ -1570,8 +1570,7 @@ err_ops:
 
 /* The probe function for RapidIO peer-to-peer network.
  */
-static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev,
-                                    const struct of_device_id *match)
+static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev)
 {
        int rc;
        printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",
@@ -1594,7 +1593,7 @@ static const struct of_device_id fsl_of_rio_rpn_ids[] = {
        {},
 };
 
-static struct of_platform_driver fsl_of_rio_rpn_driver = {
+static struct platform_driver fsl_of_rio_rpn_driver = {
        .driver = {
                .name = "fsl-of-rio",
                .owner = THIS_MODULE,
@@ -1605,7 +1604,7 @@ static struct of_platform_driver fsl_of_rio_rpn_driver = {
 
 static __init int fsl_of_rio_rpn_init(void)
 {
-       return of_register_platform_driver(&fsl_of_rio_rpn_driver);
+       return platform_driver_register(&fsl_of_rio_rpn_driver);
 }
 
 subsys_initcall(fsl_of_rio_rpn_init);
index 4260f368db5233391769204de3da3f67db1cf07c..8ce4fc3d98281a46285571a93b4f8ce51a95e34d 100644 (file)
@@ -121,8 +121,7 @@ static void pmi_notify_handlers(struct work_struct *work)
        spin_unlock(&data->handler_spinlock);
 }
 
-static int pmi_of_probe(struct platform_device *dev,
-                       const struct of_device_id *match)
+static int pmi_of_probe(struct platform_device *dev)
 {
        struct device_node *np = dev->dev.of_node;
        int rc;
@@ -205,7 +204,7 @@ static int pmi_of_remove(struct platform_device *dev)
        return 0;
 }
 
-static struct of_platform_driver pmi_of_platform_driver = {
+static struct platform_driver pmi_of_platform_driver = {
        .probe          = pmi_of_probe,
        .remove         = pmi_of_remove,
        .driver = {
@@ -217,13 +216,13 @@ static struct of_platform_driver pmi_of_platform_driver = {
 
 static int __init pmi_module_init(void)
 {
-       return of_register_platform_driver(&pmi_of_platform_driver);
+       return platform_driver_register(&pmi_of_platform_driver);
 }
 module_init(pmi_module_init);
 
 static void __exit pmi_module_exit(void)
 {
-       of_unregister_platform_driver(&pmi_of_platform_driver);
+       platform_driver_unregister(&pmi_of_platform_driver);
 }
 module_exit(pmi_module_exit);
 
index 90020de4dcf2c7570e371569997506e5642c8c5f..904c6cbaf45b23b4c6ffd0655a8a4f47f13015d2 100644 (file)
@@ -659,8 +659,7 @@ static int qe_resume(struct platform_device *ofdev)
        return 0;
 }
 
-static int qe_probe(struct platform_device *ofdev,
-                   const struct of_device_id *id)
+static int qe_probe(struct platform_device *ofdev)
 {
        return 0;
 }
@@ -670,7 +669,7 @@ static const struct of_device_id qe_ids[] = {
        { },
 };
 
-static struct of_platform_driver qe_driver = {
+static struct platform_driver qe_driver = {
        .driver = {
                .name = "fsl-qe",
                .owner = THIS_MODULE,
@@ -682,7 +681,7 @@ static struct of_platform_driver qe_driver = {
 
 static int __init qe_drv_init(void)
 {
-       return of_register_platform_driver(&qe_driver);
+       return platform_driver_register(&qe_driver);
 }
 device_initcall(qe_drv_init);
 #endif /* defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx) */
index aa4c82648d881d610e9c171523ceb2a9ea14db81..cb33608cc68f3c7c40a01e5ff49949b0ac15f0bf 100644 (file)
@@ -103,7 +103,7 @@ static inline unsigned int get_dma_residue(unsigned int dmanr)
        return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
 }
 
-static int __devinit ecpp_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit ecpp_probe(struct platform_device *op)
 {
        unsigned long base = op->resource[0].start;
        unsigned long config = op->resource[1].start;
@@ -235,7 +235,7 @@ static const struct of_device_id ecpp_match[] = {
        {},
 };
 
-static struct of_platform_driver ecpp_driver = {
+static struct platform_driver ecpp_driver = {
        .driver = {
                .name = "ecpp",
                .owner = THIS_MODULE,
@@ -247,7 +247,7 @@ static struct of_platform_driver ecpp_driver = {
 
 static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
 {
-       return of_register_platform_driver(&ecpp_driver);
+       return platform_driver_register(&ecpp_driver);
 }
 
 #endif /* !(_ASM_SPARC64_PARPORT_H */
index 52de4a9424e86a781a034770352e8b0b5df2ffac..f679c57644d5f44b6bc710e060d86ace2c73b4ee 100644 (file)
@@ -137,8 +137,7 @@ static const struct file_operations apc_fops = {
 
 static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
 
-static int __devinit apc_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit apc_probe(struct platform_device *op)
 {
        int err;
 
@@ -174,7 +173,7 @@ static struct of_device_id __initdata apc_match[] = {
 };
 MODULE_DEVICE_TABLE(of, apc_match);
 
-static struct of_platform_driver apc_driver = {
+static struct platform_driver apc_driver = {
        .driver = {
                .name = "apc",
                .owner = THIS_MODULE,
@@ -185,7 +184,7 @@ static struct of_platform_driver apc_driver = {
 
 static int __init apc_init(void)
 {
-       return of_register_platform_driver(&apc_driver);
+       return platform_driver_register(&apc_driver);
 }
 
 /* This driver is not critical to the boot process
index 3efd3c5af6a910181c47ba0075d7a95ae036beaf..2abace076c7d84e21dd971ff817d6842bffd5edd 100644 (file)
@@ -102,8 +102,7 @@ static struct of_device_id __initdata auxio_match[] = {
 
 MODULE_DEVICE_TABLE(of, auxio_match);
 
-static int __devinit auxio_probe(struct platform_device *dev,
-                                const struct of_device_id *match)
+static int __devinit auxio_probe(struct platform_device *dev)
 {
        struct device_node *dp = dev->dev.of_node;
        unsigned long size;
@@ -132,7 +131,7 @@ static int __devinit auxio_probe(struct platform_device *dev,
        return 0;
 }
 
-static struct of_platform_driver auxio_driver = {
+static struct platform_driver auxio_driver = {
        .probe          = auxio_probe,
        .driver = {
                .name = "auxio",
@@ -143,7 +142,7 @@ static struct of_platform_driver auxio_driver = {
 
 static int __init auxio_init(void)
 {
-       return of_register_platform_driver(&auxio_driver);
+       return platform_driver_register(&auxio_driver);
 }
 
 /* Must be after subsys_initcall() so that busses are probed.  Must
index cfa2624c5332ea43f20c9232555b80a3e95fde59..136d3718a74a365d27156c70b4a9c7f7614646f2 100644 (file)
@@ -59,8 +59,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)
        }
 }
 
-static int __devinit clock_board_probe(struct platform_device *op,
-                                      const struct of_device_id *match)
+static int __devinit clock_board_probe(struct platform_device *op)
 {
        struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
        int err = -ENOMEM;
@@ -148,7 +147,7 @@ static struct of_device_id __initdata clock_board_match[] = {
        {},
 };
 
-static struct of_platform_driver clock_board_driver = {
+static struct platform_driver clock_board_driver = {
        .probe          = clock_board_probe,
        .driver = {
                .name = "clock_board",
@@ -157,8 +156,7 @@ static struct of_platform_driver clock_board_driver = {
        },
 };
 
-static int __devinit fhc_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit fhc_probe(struct platform_device *op)
 {
        struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
        int err = -ENOMEM;
@@ -254,7 +252,7 @@ static struct of_device_id __initdata fhc_match[] = {
        {},
 };
 
-static struct of_platform_driver fhc_driver = {
+static struct platform_driver fhc_driver = {
        .probe          = fhc_probe,
        .driver = {
                .name = "fhc",
@@ -265,8 +263,8 @@ static struct of_platform_driver fhc_driver = {
 
 static int __init sunfire_init(void)
 {
-       (void) of_register_platform_driver(&fhc_driver);
-       (void) of_register_platform_driver(&clock_board_driver);
+       (void) platform_driver_register(&fhc_driver);
+       (void) platform_driver_register(&clock_board_driver);
        return 0;
 }
 
index 08c466ebb32b6c677c386f543211e8663ec46ae7..668c7be5d365265b8f3ea4a645c196d528a772d6 100644 (file)
@@ -392,8 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,
        }
 }
 
-static int __devinit jbusmc_probe(struct platform_device *op,
-                                 const struct of_device_id *match)
+static int __devinit jbusmc_probe(struct platform_device *op)
 {
        const struct linux_prom64_registers *mem_regs;
        struct device_node *mem_node;
@@ -690,8 +689,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
                                      chmc_read_mcreg(p, CHMCTRL_DECODE4));
 }
 
-static int __devinit chmc_probe(struct platform_device *op,
-                               const struct of_device_id *match)
+static int __devinit chmc_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        unsigned long ver;
@@ -765,13 +763,12 @@ out_free:
        goto out;
 }
 
-static int __devinit us3mc_probe(struct platform_device *op,
-                               const struct of_device_id *match)
+static int __devinit us3mc_probe(struct platform_device *op)
 {
        if (mc_type == MC_TYPE_SAFARI)
-               return chmc_probe(op, match);
+               return chmc_probe(op);
        else if (mc_type == MC_TYPE_JBUS)
-               return jbusmc_probe(op, match);
+               return jbusmc_probe(op);
        return -ENODEV;
 }
 
@@ -810,7 +807,7 @@ static const struct of_device_id us3mc_match[] = {
 };
 MODULE_DEVICE_TABLE(of, us3mc_match);
 
-static struct of_platform_driver us3mc_driver = {
+static struct platform_driver us3mc_driver = {
        .driver = {
                .name = "us3mc",
                .owner = THIS_MODULE,
@@ -848,7 +845,7 @@ static int __init us3mc_init(void)
        ret = register_dimm_printer(us3mc_dimm_printer);
 
        if (!ret) {
-               ret = of_register_platform_driver(&us3mc_driver);
+               ret = platform_driver_register(&us3mc_driver);
                if (ret)
                        unregister_dimm_printer(us3mc_dimm_printer);
        }
@@ -859,7 +856,7 @@ static void __exit us3mc_cleanup(void)
 {
        if (us3mc_platform()) {
                unregister_dimm_printer(us3mc_dimm_printer);
-               of_unregister_platform_driver(&us3mc_driver);
+               platform_driver_unregister(&us3mc_driver);
        }
 }
 
index efb896d6875404da7d7d75d140198a24c7a9a849..be5e2441c6d787207b014cc6c9b75f4c55ae555f 100644 (file)
@@ -455,8 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
        return 0;
 }
 
-static int __devinit fire_probe(struct platform_device *op,
-                               const struct of_device_id *match)
+static int __devinit fire_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct pci_pbm_info *pbm;
@@ -507,7 +506,7 @@ static struct of_device_id __initdata fire_match[] = {
        {},
 };
 
-static struct of_platform_driver fire_driver = {
+static struct platform_driver fire_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -518,7 +517,7 @@ static struct of_platform_driver fire_driver = {
 
 static int __init fire_init(void)
 {
-       return of_register_platform_driver(&fire_driver);
+       return platform_driver_register(&fire_driver);
 }
 
 subsys_initcall(fire_init);
index 22eab7cf3b11eacae552083daacd3afff488e7ef..56ee745064de6c036469164ad9a04291dab2b3f3 100644 (file)
@@ -503,8 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)
 
 #define PSYCHO_CONFIGSPACE     0x001000000UL
 
-static int __devinit psycho_probe(struct platform_device *op,
-                                 const struct of_device_id *match)
+static int __devinit psycho_probe(struct platform_device *op)
 {
        const struct linux_prom64_registers *pr_regs;
        struct device_node *dp = op->dev.of_node;
@@ -601,7 +600,7 @@ static struct of_device_id __initdata psycho_match[] = {
        {},
 };
 
-static struct of_platform_driver psycho_driver = {
+static struct platform_driver psycho_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -612,7 +611,7 @@ static struct of_platform_driver psycho_driver = {
 
 static int __init psycho_init(void)
 {
-       return of_register_platform_driver(&psycho_driver);
+       return platform_driver_register(&psycho_driver);
 }
 
 subsys_initcall(psycho_init);
index 5c3f5ec4cabc0ee00d229be774d636eb17b24d77..2857073342d2079dcaa9a90a3ced77dbdf12d1fe 100644 (file)
@@ -452,8 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
        sabre_scan_bus(pbm, &op->dev);
 }
 
-static int __devinit sabre_probe(struct platform_device *op,
-                                const struct of_device_id *match)
+static int __devinit sabre_probe(struct platform_device *op)
 {
        const struct linux_prom64_registers *pr_regs;
        struct device_node *dp = op->dev.of_node;
@@ -464,7 +463,7 @@ static int __devinit sabre_probe(struct platform_device *op,
        const u32 *vdma;
        u64 clear_irq;
 
-       hummingbird_p = (match->data != NULL);
+       hummingbird_p = op->dev.of_match && (op->dev.of_match->data != NULL);
        if (!hummingbird_p) {
                struct device_node *cpu_dp;
 
@@ -595,7 +594,7 @@ static struct of_device_id __initdata sabre_match[] = {
        {},
 };
 
-static struct of_platform_driver sabre_driver = {
+static struct platform_driver sabre_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -606,7 +605,7 @@ static struct of_platform_driver sabre_driver = {
 
 static int __init sabre_init(void)
 {
-       return of_register_platform_driver(&sabre_driver);
+       return platform_driver_register(&sabre_driver);
 }
 
 subsys_initcall(sabre_init);
index 445a47a2fb3ddf91305a9004fc699f9e09384b99..6783410ceb025ee79454796809987c37affa7c9a 100644 (file)
@@ -1460,10 +1460,11 @@ out_err:
        return err;
 }
 
-static int __devinit schizo_probe(struct platform_device *op,
-                                 const struct of_device_id *match)
+static int __devinit schizo_probe(struct platform_device *op)
 {
-       return __schizo_init(op, (unsigned long) match->data);
+       if (!op->dev.of_match)
+               return -EINVAL;
+       return __schizo_init(op, (unsigned long) op->dev.of_match->data);
 }
 
 /* The ordering of this table is very important.  Some Tomatillo
@@ -1490,7 +1491,7 @@ static struct of_device_id __initdata schizo_match[] = {
        {},
 };
 
-static struct of_platform_driver schizo_driver = {
+static struct platform_driver schizo_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -1501,7 +1502,7 @@ static struct of_platform_driver schizo_driver = {
 
 static int __init schizo_init(void)
 {
-       return of_register_platform_driver(&schizo_driver);
+       return platform_driver_register(&schizo_driver);
 }
 
 subsys_initcall(schizo_init);
index 743344aa6d8a6a1d6f32738b3e5c1f40352f67d9..158cd739b263bc762cf343529984da1e9cef191d 100644 (file)
@@ -918,8 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
        return 0;
 }
 
-static int __devinit pci_sun4v_probe(struct platform_device *op,
-                                    const struct of_device_id *match)
+static int __devinit pci_sun4v_probe(struct platform_device *op)
 {
        const struct linux_prom64_registers *regs;
        static int hvapi_negotiated = 0;
@@ -1008,7 +1007,7 @@ static struct of_device_id __initdata pci_sun4v_match[] = {
        {},
 };
 
-static struct of_platform_driver pci_sun4v_driver = {
+static struct platform_driver pci_sun4v_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -1019,7 +1018,7 @@ static struct of_platform_driver pci_sun4v_driver = {
 
 static int __init pci_sun4v_init(void)
 {
-       return of_register_platform_driver(&pci_sun4v_driver);
+       return platform_driver_register(&pci_sun4v_driver);
 }
 
 subsys_initcall(pci_sun4v_init);
index 94536a85f16110f69aa89520f574404bc2438daa..93d7b4465f8d2493dc542d0e836ac255182e25f2 100644 (file)
@@ -51,8 +51,7 @@ static void pmc_swift_idle(void)
 #endif
 }
 
-static int __devinit pmc_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit pmc_probe(struct platform_device *op)
 {
        regs = of_ioremap(&op->resource[0], 0,
                          resource_size(&op->resource[0]), PMC_OBPNAME);
@@ -78,7 +77,7 @@ static struct of_device_id __initdata pmc_match[] = {
 };
 MODULE_DEVICE_TABLE(of, pmc_match);
 
-static struct of_platform_driver pmc_driver = {
+static struct platform_driver pmc_driver = {
        .driver = {
                .name = "pmc",
                .owner = THIS_MODULE,
@@ -89,7 +88,7 @@ static struct of_platform_driver pmc_driver = {
 
 static int __init pmc_init(void)
 {
-       return of_register_platform_driver(&pmc_driver);
+       return platform_driver_register(&pmc_driver);
 }
 
 /* This driver is not critical to the boot process
index 2c59f4d387dd6cf68e0c8bcd140be5bb67e551d5..cd725fe238b2d1b5378df7432f4115a992f4e392 100644 (file)
@@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
        return 1;
 }
 
-static int __devinit power_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit power_probe(struct platform_device *op)
 {
        struct resource *res = &op->resource[0];
        unsigned int irq = op->archdata.irqs[0];
@@ -59,7 +59,7 @@ static struct of_device_id __initdata power_match[] = {
        {},
 };
 
-static struct of_platform_driver power_driver = {
+static struct platform_driver power_driver = {
        .probe          = power_probe,
        .driver = {
                .name = "power",
@@ -70,7 +70,7 @@ static struct of_platform_driver power_driver = {
 
 static int __init power_init(void)
 {
-       return of_register_platform_driver(&power_driver);
+       return platform_driver_register(&power_driver);
 }
 
 device_initcall(power_init);
index 4211bfc9bcadc0249d1ba2f83a0e2837bd1ac243..19ab42a932db918a307c0c1451166e922b91bef3 100644 (file)
@@ -137,7 +137,7 @@ static struct platform_device m48t59_rtc = {
        },
 };
 
-static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit clock_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        const char *model = of_get_property(dp, "model", NULL);
@@ -171,7 +171,7 @@ static struct of_device_id __initdata clock_match[] = {
        {},
 };
 
-static struct of_platform_driver clock_driver = {
+static struct platform_driver clock_driver = {
        .probe          = clock_probe,
        .driver = {
                .name = "rtc",
@@ -184,7 +184,7 @@ static struct of_platform_driver clock_driver = {
 /* Probe for the mostek real time clock chip. */
 static int __init clock_init(void)
 {
-       return of_register_platform_driver(&clock_driver);
+       return platform_driver_register(&clock_driver);
 }
 /* Must be after subsys_initcall() so that busses are probed.  Must
  * be before device_initcall() because things like the RTC driver
index 3bc9c9979b92fd1533caab3a5d1b8959c4c8855e..e1862793a61d5ec82a51bd8c124852acd0c795a0 100644 (file)
@@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {
        .num_resources  = 1,
 };
 
-static int __devinit rtc_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit rtc_probe(struct platform_device *op)
 {
        struct resource *r;
 
@@ -462,7 +462,7 @@ static struct of_device_id __initdata rtc_match[] = {
        {},
 };
 
-static struct of_platform_driver rtc_driver = {
+static struct platform_driver rtc_driver = {
        .probe          = rtc_probe,
        .driver = {
                .name = "rtc",
@@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {
        .num_resources  = 1,
 };
 
-static int __devinit bq4802_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit bq4802_probe(struct platform_device *op)
 {
 
        printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
@@ -495,7 +495,7 @@ static struct of_device_id __initdata bq4802_match[] = {
        {},
 };
 
-static struct of_platform_driver bq4802_driver = {
+static struct platform_driver bq4802_driver = {
        .probe          = bq4802_probe,
        .driver = {
                .name = "bq4802",
@@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {
        },
 };
 
-static int __devinit mostek_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit mostek_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
 
@@ -559,7 +559,7 @@ static struct of_device_id __initdata mostek_match[] = {
        {},
 };
 
-static struct of_platform_driver mostek_driver = {
+static struct platform_driver mostek_driver = {
        .probe          = mostek_probe,
        .driver = {
                .name = "mostek",
@@ -586,9 +586,9 @@ static int __init clock_init(void)
        if (tlb_type == hypervisor)
                return platform_device_register(&rtc_sun4v_device);
 
-       (void) of_register_platform_driver(&rtc_driver);
-       (void) of_register_platform_driver(&mostek_driver);
-       (void) of_register_platform_driver(&bq4802_driver);
+       (void) platform_driver_register(&rtc_driver);
+       (void) platform_driver_register(&mostek_driver);
+       (void) platform_driver_register(&bq4802_driver);
 
        return 0;
 }
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 712ab5a4922e66bd2847ab54e630fec3f714e425..1c4b3aa4c7c40da65c8c6f86f936be6891839e6c 100644 (file)
@@ -1625,8 +1625,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;
@@ -1764,7 +1763,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,
@@ -1776,12 +1775,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 7f9eab34a386be7d44ef7690156f2dd882fa32f9..ef3ce26bb1f0217c3e6b7d55ae5b0f6426f526b4 100644 (file)
@@ -1300,8 +1300,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;
@@ -1437,7 +1436,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,
@@ -1453,13 +1452,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 a3f5e381e74647268517a22c6f65d7c641277f3d..43ac61978d8b2661672418901bde4242462a6165 100644 (file)
@@ -619,15 +619,17 @@ static void __devinit n2rng_driver_version(void)
                pr_info("%s", version);
 }
 
-static int __devinit n2rng_probe(struct platform_device *op,
-                                const struct of_device_id *match)
+static int __devinit n2rng_probe(struct platform_device *op)
 {
-       int victoria_falls = (match->data != NULL);
+       int victoria_falls;
        int err = -ENOMEM;
        struct n2rng *np;
 
-       n2rng_driver_version();
+       if (!op->dev.of_match)
+               return -EINVAL;
+       victoria_falls = (op->dev.of_match->data != NULL);
 
+       n2rng_driver_version();
        np = kzalloc(sizeof(*np), GFP_KERNEL);
        if (!np)
                goto out;
@@ -750,7 +752,7 @@ static const struct of_device_id n2rng_match[] = {
 };
 MODULE_DEVICE_TABLE(of, n2rng_match);
 
-static struct of_platform_driver n2rng_driver = {
+static struct platform_driver n2rng_driver = {
        .driver = {
                .name = "n2rng",
                .owner = THIS_MODULE,
@@ -762,12 +764,12 @@ static struct of_platform_driver n2rng_driver = {
 
 static int __init n2rng_init(void)
 {
-       return of_register_platform_driver(&n2rng_driver);
+       return platform_driver_register(&n2rng_driver);
 }
 
 static void __exit n2rng_exit(void)
 {
-       of_unregister_platform_driver(&n2rng_driver);
+       platform_driver_unregister(&n2rng_driver);
 }
 
 module_init(n2rng_init);
index a31c830ca8cd72f853298477ae55dd34192920bd..1d504815e6db2cb8f4a77d35ed096ecd58c7f09f 100644 (file)
@@ -94,8 +94,7 @@ static struct hwrng pasemi_rng = {
        .data_read      = pasemi_rng_data_read,
 };
 
-static int __devinit rng_probe(struct platform_device *ofdev,
-                              const struct of_device_id *match)
+static int __devinit rng_probe(struct platform_device *ofdev)
 {
        void __iomem *rng_regs;
        struct device_node *rng_np = ofdev->dev.of_node;
@@ -139,7 +138,7 @@ static struct of_device_id rng_match[] = {
        { },
 };
 
-static struct of_platform_driver rng_driver = {
+static struct platform_driver rng_driver = {
        .driver = {
                .name = "pasemi-rng",
                .owner = THIS_MODULE,
@@ -151,13 +150,13 @@ static struct of_platform_driver rng_driver = {
 
 static int __init rng_init(void)
 {
-       return of_register_platform_driver(&rng_driver);
+       return platform_driver_register(&rng_driver);
 }
 module_init(rng_init);
 
 static void __exit rng_exit(void)
 {
-       of_unregister_platform_driver(&rng_driver);
+       platform_driver_unregister(&rng_driver);
 }
 module_exit(rng_exit);
 
index 62787e30d508c2e63fe8f7923fbc45a63493a545..c86d43b88e1ec54f59a0a0aa2864d1b4a09c7f72 100644 (file)
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/pnp.h>
-
-#ifdef CONFIG_PPC_OF
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
-#endif
 
 #define PFX "ipmi_si: "
 
@@ -116,13 +113,7 @@ static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI",
 
 #define DEVICE_NAME "ipmi_si"
 
-static struct platform_driver ipmi_driver = {
-       .driver = {
-               .name = DEVICE_NAME,
-               .bus = &platform_bus_type
-       }
-};
-
+static struct platform_driver ipmi_driver;
 
 /*
  * Indexes into stats[] in smi_info below.
@@ -308,9 +299,6 @@ static int pci_registered;
 #ifdef CONFIG_ACPI
 static int pnp_registered;
 #endif
-#ifdef CONFIG_PPC_OF
-static int of_registered;
-#endif
 
 static unsigned int kipmid_max_busy_us[SI_MAX_PARMS];
 static int num_max_busy_us;
@@ -1868,8 +1856,9 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
        return rv;
 }
 
-static void __devinit hardcode_find_bmc(void)
+static int __devinit hardcode_find_bmc(void)
 {
+       int ret = -ENODEV;
        int             i;
        struct smi_info *info;
 
@@ -1879,7 +1868,7 @@ static void __devinit hardcode_find_bmc(void)
 
                info = smi_info_alloc();
                if (!info)
-                       return;
+                       return -ENOMEM;
 
                info->addr_source = SI_HARDCODED;
                printk(KERN_INFO PFX "probing via hardcoded address\n");
@@ -1932,10 +1921,12 @@ static void __devinit hardcode_find_bmc(void)
                if (!add_smi(info)) {
                        if (try_smi_init(info))
                                cleanup_one_si(info);
+                       ret = 0;
                } else {
                        kfree(info);
                }
        }
+       return ret;
 }
 
 #ifdef CONFIG_ACPI
@@ -2563,11 +2554,9 @@ static struct pci_driver ipmi_pci_driver = {
 };
 #endif /* CONFIG_PCI */
 
-
-#ifdef CONFIG_PPC_OF
-static int __devinit ipmi_of_probe(struct platform_device *dev,
-                        const struct of_device_id *match)
+static int __devinit ipmi_probe(struct platform_device *dev)
 {
+#ifdef CONFIG_OF
        struct smi_info *info;
        struct resource resource;
        const __be32 *regsize, *regspacing, *regshift;
@@ -2577,6 +2566,9 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
 
        dev_info(&dev->dev, "probing via device tree\n");
 
+       if (!dev->dev.of_match)
+               return -EINVAL;
+
        ret = of_address_to_resource(np, 0, &resource);
        if (ret) {
                dev_warn(&dev->dev, PFX "invalid address from OF\n");
@@ -2609,7 +2601,7 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
                return -ENOMEM;
        }
 
-       info->si_type           = (enum si_type) match->data;
+       info->si_type           = (enum si_type) dev->dev.of_match->data;
        info->addr_source       = SI_DEVICETREE;
        info->irq_setup         = std_irq_setup;
 
@@ -2640,13 +2632,15 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
                kfree(info);
                return -EBUSY;
        }
-
+#endif
        return 0;
 }
 
-static int __devexit ipmi_of_remove(struct platform_device *dev)
+static int __devexit ipmi_remove(struct platform_device *dev)
 {
+#ifdef CONFIG_OF
        cleanup_one_si(dev_get_drvdata(&dev->dev));
+#endif
        return 0;
 }
 
@@ -2661,16 +2655,15 @@ static struct of_device_id ipmi_match[] =
        {},
 };
 
-static struct of_platform_driver ipmi_of_platform_driver = {
+static struct platform_driver ipmi_driver = {
        .driver = {
-               .name = "ipmi",
+               .name = DEVICE_NAME,
                .owner = THIS_MODULE,
                .of_match_table = ipmi_match,
        },
-       .probe          = ipmi_of_probe,
-       .remove         = __devexit_p(ipmi_of_remove),
+       .probe          = ipmi_probe,
+       .remove         = __devexit_p(ipmi_remove),
 };
-#endif /* CONFIG_PPC_OF */
 
 static int wait_for_msg_done(struct smi_info *smi_info)
 {
@@ -3348,8 +3341,7 @@ static int __devinit init_ipmi_si(void)
                return 0;
        initialized = 1;
 
-       /* Register the device drivers. */
-       rv = driver_register(&ipmi_driver.driver);
+       rv = platform_driver_register(&ipmi_driver);
        if (rv) {
                printk(KERN_ERR PFX "Unable to register driver: %d\n", rv);
                return rv;
@@ -3373,15 +3365,9 @@ static int __devinit init_ipmi_si(void)
 
        printk(KERN_INFO "IPMI System Interface driver.\n");
 
-       hardcode_find_bmc();
-
        /* If the user gave us a device, they presumably want us to use it */
-       mutex_lock(&smi_infos_lock);
-       if (!list_empty(&smi_infos)) {
-               mutex_unlock(&smi_infos_lock);
+       if (!hardcode_find_bmc())
                return 0;
-       }
-       mutex_unlock(&smi_infos_lock);
 
 #ifdef CONFIG_PCI
        rv = pci_register_driver(&ipmi_pci_driver);
@@ -3404,11 +3390,6 @@ static int __devinit init_ipmi_si(void)
        spmi_find_bmc();
 #endif
 
-#ifdef CONFIG_PPC_OF
-       of_register_platform_driver(&ipmi_of_platform_driver);
-       of_registered = 1;
-#endif
-
        /* We prefer devices with interrupts, but in the case of a machine
           with multiple BMCs we assume that there will be several instances
           of a given type so if we succeed in registering a type then also
@@ -3556,17 +3537,12 @@ static void __exit cleanup_ipmi_si(void)
                pnp_unregister_driver(&ipmi_pnp_driver);
 #endif
 
-#ifdef CONFIG_PPC_OF
-       if (of_registered)
-               of_unregister_platform_driver(&ipmi_of_platform_driver);
-#endif
+       platform_driver_unregister(&ipmi_driver);
 
        mutex_lock(&smi_infos_lock);
        list_for_each_entry_safe(e, tmp_e, &smi_infos, link)
                cleanup_one_si(e);
        mutex_unlock(&smi_infos_lock);
-
-       driver_unregister(&ipmi_driver.driver);
 }
 module_exit(cleanup_ipmi_si);
 
index 9f2272e6de1c160e1566eb5b01c63f45ddb2a129..d3c9d755ed9870b0286c498fd256a970dd0f9bad 100644 (file)
@@ -714,20 +714,29 @@ static int __devexit hwicap_remove(struct device *dev)
        return 0;               /* success */
 }
 
-static int __devinit hwicap_drv_probe(struct platform_device *pdev)
+#ifdef CONFIG_OF
+static int __devinit hwicap_of_probe(struct platform_device *op)
 {
-       struct resource *res;
-       const struct config_registers *regs;
+       struct resource res;
+       const unsigned int *id;
        const char *family;
+       int rc;
+       const struct hwicap_driver_config *config = op->dev.of_match->data;
+       const struct config_registers *regs;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENODEV;
+
+       rc = of_address_to_resource(op->dev.of_node, 0, &res);
+       if (rc) {
+               dev_err(&op->dev, "invalid address\n");
+               return rc;
+       }
+
+       id = of_get_property(op->dev.of_node, "port-number", NULL);
 
        /* It's most likely that we're using V4, if the family is not
           specified */
        regs = &v4_config_registers;
-       family = pdev->dev.platform_data;
+       family = of_get_property(op->dev.of_node, "xlnx,family", NULL);
 
        if (family) {
                if (!strcmp(family, "virtex2p")) {
@@ -738,54 +747,33 @@ static int __devinit hwicap_drv_probe(struct platform_device *pdev)
                        regs = &v5_config_registers;
                }
        }
-
-       return hwicap_setup(&pdev->dev, pdev->id, res,
-                       &buffer_icap_config, regs);
+       return hwicap_setup(&op->dev, id ? *id : -1, &res, config,
+                       regs);
 }
-
-static int __devexit hwicap_drv_remove(struct platform_device *pdev)
+#else
+static inline int hwicap_of_probe(struct platform_device *op)
 {
-       return hwicap_remove(&pdev->dev);
+       return -EINVAL;
 }
+#endif /* CONFIG_OF */
 
-static struct platform_driver hwicap_platform_driver = {
-       .probe = hwicap_drv_probe,
-       .remove = hwicap_drv_remove,
-       .driver = {
-               .owner = THIS_MODULE,
-               .name = DRIVER_NAME,
-       },
-};
-
-/* ---------------------------------------------------------------------
- * OF bus binding
- */
-
-#if defined(CONFIG_OF)
-static int __devinit
-hwicap_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit hwicap_drv_probe(struct platform_device *pdev)
 {
-       struct resource res;
-       const unsigned int *id;
-       const char *family;
-       int rc;
-       const struct hwicap_driver_config *config = match->data;
+       struct resource *res;
        const struct config_registers *regs;
+       const char *family;
 
-       dev_dbg(&op->dev, "hwicap_of_probe(%p, %p)\n", op, match);
-
-       rc = of_address_to_resource(op->dev.of_node, 0, &res);
-       if (rc) {
-               dev_err(&op->dev, "invalid address\n");
-               return rc;
-       }
+       if (pdev->dev.of_match)
+               return hwicap_of_probe(pdev);
 
-       id = of_get_property(op->dev.of_node, "port-number", NULL);
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res)
+               return -ENODEV;
 
        /* It's most likely that we're using V4, if the family is not
           specified */
        regs = &v4_config_registers;
-       family = of_get_property(op->dev.of_node, "xlnx,family", NULL);
+       family = pdev->dev.platform_data;
 
        if (family) {
                if (!strcmp(family, "virtex2p")) {
@@ -796,50 +784,38 @@ hwicap_of_probe(struct platform_device *op, const struct of_device_id *match)
                        regs = &v5_config_registers;
                }
        }
-       return hwicap_setup(&op->dev, id ? *id : -1, &res, config,
-                       regs);
+
+       return hwicap_setup(&pdev->dev, pdev->id, res,
+                       &buffer_icap_config, regs);
 }
 
-static int __devexit hwicap_of_remove(struct platform_device *op)
+static int __devexit hwicap_drv_remove(struct platform_device *pdev)
 {
-       return hwicap_remove(&op->dev);
+       return hwicap_remove(&pdev->dev);
 }
 
-/* Match table for of_platform binding */
+#ifdef CONFIG_OF
+/* Match table for device tree binding */
 static const struct of_device_id __devinitconst hwicap_of_match[] = {
        { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
        { .compatible = "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config},
        {},
 };
 MODULE_DEVICE_TABLE(of, hwicap_of_match);
+#else
+#define hwicap_of_match NULL
+#endif
 
-static struct of_platform_driver hwicap_of_driver = {
-       .probe = hwicap_of_probe,
-       .remove = __devexit_p(hwicap_of_remove),
+static struct platform_driver hwicap_platform_driver = {
+       .probe = hwicap_drv_probe,
+       .remove = hwicap_drv_remove,
        .driver = {
-               .name = DRIVER_NAME,
                .owner = THIS_MODULE,
+               .name = DRIVER_NAME,
                .of_match_table = hwicap_of_match,
        },
 };
 
-/* Registration helpers to keep the number of #ifdefs to a minimum */
-static inline int __init hwicap_of_register(void)
-{
-       pr_debug("hwicap: calling of_register_platform_driver()\n");
-       return of_register_platform_driver(&hwicap_of_driver);
-}
-
-static inline void __exit hwicap_of_unregister(void)
-{
-       of_unregister_platform_driver(&hwicap_of_driver);
-}
-#else /* CONFIG_OF */
-/* CONFIG_OF not enabled; do nothing helpers */
-static inline int __init hwicap_of_register(void) { return 0; }
-static inline void __exit hwicap_of_unregister(void) { }
-#endif /* CONFIG_OF */
-
 static int __init hwicap_module_init(void)
 {
        dev_t devt;
@@ -856,21 +832,12 @@ static int __init hwicap_module_init(void)
                return retval;
 
        retval = platform_driver_register(&hwicap_platform_driver);
-
-       if (retval)
-               goto failed1;
-
-       retval = hwicap_of_register();
-
        if (retval)
-               goto failed2;
+               goto failed;
 
        return retval;
 
- failed2:
-       platform_driver_unregister(&hwicap_platform_driver);
-
- failed1:
+ failed:
        unregister_chrdev_region(devt, HWICAP_DEVICES);
 
        return retval;
@@ -884,8 +851,6 @@ static void __exit hwicap_module_cleanup(void)
 
        platform_driver_unregister(&hwicap_platform_driver);
 
-       hwicap_of_unregister();
-
        unregister_chrdev_region(devt, HWICAP_DEVICES);
 }
 
index 2b1baee525bcc6023ce065c699b3f0fa0642fa1b..18912521a7a585571a6a23a1d7d4782d453b6642 100644 (file)
@@ -1150,8 +1150,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
 /**
  * Module Initialization Routine
  */
-static int __init crypto4xx_probe(struct platform_device *ofdev,
-                                 const struct of_device_id *match)
+static int __init crypto4xx_probe(struct platform_device *ofdev)
 {
        int rc;
        struct resource res;
@@ -1280,7 +1279,7 @@ static const struct of_device_id crypto4xx_match[] = {
        { },
 };
 
-static struct of_platform_driver crypto4xx_driver = {
+static struct platform_driver crypto4xx_driver = {
        .driver = {
                .name = "crypto4xx",
                .owner = THIS_MODULE,
@@ -1292,12 +1291,12 @@ static struct of_platform_driver crypto4xx_driver = {
 
 static int __init crypto4xx_init(void)
 {
-       return of_register_platform_driver(&crypto4xx_driver);
+       return platform_driver_register(&crypto4xx_driver);
 }
 
 static void __exit crypto4xx_exit(void)
 {
-       of_unregister_platform_driver(&crypto4xx_driver);
+       platform_driver_unregister(&crypto4xx_driver);
 }
 
 module_init(crypto4xx_init);
index 80dc094e78c655d7f75d329762ad05891dbed3a5..2e5b2044c96f7a2cb6311a03c79d972aee49d287 100644 (file)
@@ -2004,8 +2004,7 @@ static void __devinit n2_spu_driver_version(void)
                pr_info("%s", version);
 }
 
-static int __devinit n2_crypto_probe(struct platform_device *dev,
-                                    const struct of_device_id *match)
+static int __devinit n2_crypto_probe(struct platform_device *dev)
 {
        struct mdesc_handle *mdesc;
        const char *full_name;
@@ -2116,8 +2115,7 @@ static void free_ncp(struct n2_mau *mp)
        kfree(mp);
 }
 
-static int __devinit n2_mau_probe(struct platform_device *dev,
-                                    const struct of_device_id *match)
+static int __devinit n2_mau_probe(struct platform_device *dev)
 {
        struct mdesc_handle *mdesc;
        const char *full_name;
@@ -2211,7 +2209,7 @@ static struct of_device_id n2_crypto_match[] = {
 
 MODULE_DEVICE_TABLE(of, n2_crypto_match);
 
-static struct of_platform_driver n2_crypto_driver = {
+static struct platform_driver n2_crypto_driver = {
        .driver = {
                .name           =       "n2cp",
                .owner          =       THIS_MODULE,
@@ -2235,7 +2233,7 @@ static struct of_device_id n2_mau_match[] = {
 
 MODULE_DEVICE_TABLE(of, n2_mau_match);
 
-static struct of_platform_driver n2_mau_driver = {
+static struct platform_driver n2_mau_driver = {
        .driver = {
                .name           =       "ncp",
                .owner          =       THIS_MODULE,
@@ -2247,20 +2245,20 @@ static struct of_platform_driver n2_mau_driver = {
 
 static int __init n2_init(void)
 {
-       int err = of_register_platform_driver(&n2_crypto_driver);
+       int err = platform_driver_register(&n2_crypto_driver);
 
        if (!err) {
-               err = of_register_platform_driver(&n2_mau_driver);
+               err = platform_driver_register(&n2_mau_driver);
                if (err)
-                       of_unregister_platform_driver(&n2_crypto_driver);
+                       platform_driver_unregister(&n2_crypto_driver);
        }
        return err;
 }
 
 static void __exit n2_exit(void)
 {
-       of_unregister_platform_driver(&n2_mau_driver);
-       of_unregister_platform_driver(&n2_crypto_driver);
+       platform_driver_unregister(&n2_mau_driver);
+       platform_driver_unregister(&n2_crypto_driver);
 }
 
 module_init(n2_init);
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 4de947a450fce30a1bf747c1d5f4ce454f3df2a4..e3854a8f0de02224ef24ba2e572fc4cad7e9e13e 100644 (file)
@@ -1281,8 +1281,7 @@ static void fsl_dma_chan_remove(struct fsldma_chan *chan)
        kfree(chan);
 }
 
-static int __devinit fsldma_of_probe(struct platform_device *op,
-                       const struct of_device_id *match)
+static int __devinit fsldma_of_probe(struct platform_device *op)
 {
        struct fsldma_device *fdev;
        struct device_node *child;
@@ -1414,20 +1413,13 @@ static struct of_platform_driver fsldma_of_driver = {
 
 static __init int fsldma_init(void)
 {
-       int ret;
-
        pr_info("Freescale Elo / Elo Plus DMA driver\n");
-
-       ret = of_register_platform_driver(&fsldma_of_driver);
-       if (ret)
-               pr_err("fsldma: failed to register platform driver\n");
-
-       return ret;
+       return platform_driver_register(&fsldma_of_driver);
 }
 
 static void __exit fsldma_exit(void)
 {
-       of_unregister_platform_driver(&fsldma_of_driver);
+       platform_driver_unregister(&fsldma_of_driver);
 }
 
 subsys_initcall(fsldma_init);
index 59c270192ccc308e60726b02a96ea64d2f28eecc..4f95d31f5a2062c151fa15e998c9b4936d1b2f11 100644 (file)
@@ -649,8 +649,7 @@ mpc_dma_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, dma_addr_t src,
        return &mdesc->desc;
 }
 
-static int __devinit mpc_dma_probe(struct platform_device *op,
-                                       const struct of_device_id *match)
+static int __devinit mpc_dma_probe(struct platform_device *op)
 {
        struct device_node *dn = op->dev.of_node;
        struct device *dev = &op->dev;
@@ -827,7 +826,7 @@ static struct of_device_id mpc_dma_match[] = {
        {},
 };
 
-static struct of_platform_driver mpc_dma_driver = {
+static struct platform_driver mpc_dma_driver = {
        .probe          = mpc_dma_probe,
        .remove         = __devexit_p(mpc_dma_remove),
        .driver = {
@@ -839,13 +838,13 @@ static struct of_platform_driver mpc_dma_driver = {
 
 static int __init mpc_dma_init(void)
 {
-       return of_register_platform_driver(&mpc_dma_driver);
+       return platform_driver_register(&mpc_dma_driver);
 }
 module_init(mpc_dma_init);
 
 static void __exit mpc_dma_exit(void)
 {
-       of_unregister_platform_driver(&mpc_dma_driver);
+       platform_driver_unregister(&mpc_dma_driver);
 }
 module_exit(mpc_dma_exit);
 
index cef584533ee8a9ca5628b874b5d6c644a4ad05f4..3b0247e74cc4871cb703938ef82f3146011d077f 100644 (file)
@@ -4393,8 +4393,7 @@ static void ppc440spe_adma_release_irqs(struct ppc440spe_adma_device *adev,
 /**
  * ppc440spe_adma_probe - probe the asynch device
  */
-static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev,
-                                         const struct of_device_id *match)
+static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct resource res;
@@ -4944,7 +4943,7 @@ static const struct of_device_id ppc440spe_adma_of_match[] __devinitconst = {
 };
 MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match);
 
-static struct of_platform_driver ppc440spe_adma_driver = {
+static struct platform_driver ppc440spe_adma_driver = {
        .probe = ppc440spe_adma_probe,
        .remove = __devexit_p(ppc440spe_adma_remove),
        .driver = {
@@ -4962,7 +4961,7 @@ static __init int ppc440spe_adma_init(void)
        if (ret)
                return ret;
 
-       ret = of_register_platform_driver(&ppc440spe_adma_driver);
+       ret = platform_driver_register(&ppc440spe_adma_driver);
        if (ret) {
                pr_err("%s: failed to register platform driver\n",
                        __func__);
@@ -4996,7 +4995,7 @@ out_dev:
        /* User will not be able to enable h/w RAID-6 */
        pr_err("%s: failed to create RAID-6 driver interface\n",
                __func__);
-       of_unregister_platform_driver(&ppc440spe_adma_driver);
+       platform_driver_unregister(&ppc440spe_adma_driver);
 out_reg:
        dcr_unmap(ppc440spe_mq_dcr_host, ppc440spe_mq_dcr_len);
        kfree(ppc440spe_dma_fifo_buf);
@@ -5011,7 +5010,7 @@ static void __exit ppc440spe_adma_exit(void)
                           &driver_attr_enable);
        driver_remove_file(&ppc440spe_adma_driver.driver,
                           &driver_attr_devices);
-       of_unregister_platform_driver(&ppc440spe_adma_driver);
+       platform_driver_unregister(&ppc440spe_adma_driver);
        dcr_unmap(ppc440spe_mq_dcr_host, ppc440spe_mq_dcr_len);
        kfree(ppc440spe_dma_fifo_buf);
 }
index b123bb308a4a8b50c7543179e065bc34ef2a33ff..ffb5ad080bee81b765992dfd9cc9fd06ebc09b6d 100644 (file)
@@ -200,8 +200,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int __devinit mpc85xx_pci_err_probe(struct platform_device *op,
-                                          const struct of_device_id *match)
+static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
 {
        struct edac_pci_ctl_info *pci;
        struct mpc85xx_pci_pdata *pdata;
@@ -338,7 +337,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
 
-static struct of_platform_driver mpc85xx_pci_err_driver = {
+static struct platform_driver mpc85xx_pci_err_driver = {
        .probe = mpc85xx_pci_err_probe,
        .remove = __devexit_p(mpc85xx_pci_err_remove),
        .driver = {
@@ -503,8 +502,7 @@ static irqreturn_t mpc85xx_l2_isr(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int __devinit mpc85xx_l2_err_probe(struct platform_device *op,
-                                         const struct of_device_id *match)
+static int __devinit mpc85xx_l2_err_probe(struct platform_device *op)
 {
        struct edac_device_ctl_info *edac_dev;
        struct mpc85xx_l2_pdata *pdata;
@@ -656,7 +654,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match);
 
-static struct of_platform_driver mpc85xx_l2_err_driver = {
+static struct platform_driver mpc85xx_l2_err_driver = {
        .probe = mpc85xx_l2_err_probe,
        .remove = mpc85xx_l2_err_remove,
        .driver = {
@@ -956,8 +954,7 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci)
        }
 }
 
-static int __devinit mpc85xx_mc_err_probe(struct platform_device *op,
-                                         const struct of_device_id *match)
+static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
 {
        struct mem_ctl_info *mci;
        struct mpc85xx_mc_pdata *pdata;
@@ -1136,7 +1133,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
 
-static struct of_platform_driver mpc85xx_mc_err_driver = {
+static struct platform_driver mpc85xx_mc_err_driver = {
        .probe = mpc85xx_mc_err_probe,
        .remove = mpc85xx_mc_err_remove,
        .driver = {
@@ -1171,16 +1168,16 @@ static int __init mpc85xx_mc_init(void)
                break;
        }
 
-       res = of_register_platform_driver(&mpc85xx_mc_err_driver);
+       res = platform_driver_register(&mpc85xx_mc_err_driver);
        if (res)
                printk(KERN_WARNING EDAC_MOD_STR "MC fails to register\n");
 
-       res = of_register_platform_driver(&mpc85xx_l2_err_driver);
+       res = platform_driver_register(&mpc85xx_l2_err_driver);
        if (res)
                printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n");
 
 #ifdef CONFIG_PCI
-       res = of_register_platform_driver(&mpc85xx_pci_err_driver);
+       res = platform_driver_register(&mpc85xx_pci_err_driver);
        if (res)
                printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
 #endif
@@ -1212,10 +1209,10 @@ static void __exit mpc85xx_mc_exit(void)
        on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
 #endif
 #ifdef CONFIG_PCI
-       of_unregister_platform_driver(&mpc85xx_pci_err_driver);
+       platform_driver_unregister(&mpc85xx_pci_err_driver);
 #endif
-       of_unregister_platform_driver(&mpc85xx_l2_err_driver);
-       of_unregister_platform_driver(&mpc85xx_mc_err_driver);
+       platform_driver_unregister(&mpc85xx_l2_err_driver);
+       platform_driver_unregister(&mpc85xx_mc_err_driver);
 }
 
 module_exit(mpc85xx_mc_exit);
index b9f0c20df1aa587a8e1c066b3f7cc52983427fb1..c1f0045ceb8e708ced1a6163ae921b03efe4e9d5 100644 (file)
@@ -184,8 +184,7 @@ struct ppc4xx_ecc_status {
 
 /* Function Prototypes */
 
-static int ppc4xx_edac_probe(struct platform_device *device,
-                            const struct of_device_id *device_id);
+static int ppc4xx_edac_probe(struct platform_device *device)
 static int ppc4xx_edac_remove(struct platform_device *device);
 
 /* Global Variables */
@@ -201,7 +200,7 @@ static struct of_device_id ppc4xx_edac_match[] = {
        { }
 };
 
-static struct of_platform_driver ppc4xx_edac_driver = {
+static struct platform_driver ppc4xx_edac_driver = {
        .probe                  = ppc4xx_edac_probe,
        .remove                 = ppc4xx_edac_remove,
        .driver = {
@@ -997,9 +996,6 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
  *       initialized.
  * @op: A pointer to the OpenFirmware device tree node associated
  *      with the controller this EDAC instance is bound to.
- * @match: A pointer to the OpenFirmware device tree match
- *         information associated with the controller this EDAC instance
- *         is bound to.
  * @dcr_host: A pointer to the DCR data containing the DCR mapping
  *            for this controller instance.
  * @mcopt1: The 32-bit Memory Controller Option 1 register value
@@ -1015,7 +1011,6 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
 static int __devinit
 ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
                    struct platform_device *op,
-                   const struct of_device_id *match,
                    const dcr_host_t *dcr_host,
                    u32 mcopt1)
 {
@@ -1024,7 +1019,7 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
        struct ppc4xx_edac_pdata *pdata = NULL;
        const struct device_node *np = op->dev.of_node;
 
-       if (match == NULL)
+       if (op->dev.of_match == NULL)
                return -EINVAL;
 
        /* Initial driver pointers and private data */
@@ -1227,9 +1222,6 @@ ppc4xx_edac_map_dcrs(const struct device_node *np, dcr_host_t *dcr_host)
  * ppc4xx_edac_probe - check controller and bind driver
  * @op: A pointer to the OpenFirmware device tree node associated
  *      with the controller being probed for driver binding.
- * @match: A pointer to the OpenFirmware device tree match
- *         information associated with the controller being probed
- *         for driver binding.
  *
  * This routine probes a specific ibm,sdram-4xx-ddr2 controller
  * instance for binding with the driver.
@@ -1237,8 +1229,7 @@ ppc4xx_edac_map_dcrs(const struct device_node *np, dcr_host_t *dcr_host)
  * Returns 0 if the controller instance was successfully bound to the
  * driver; otherwise, < 0 on error.
  */
-static int __devinit
-ppc4xx_edac_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit ppc4xx_edac_probe(struct platform_device *op)
 {
        int status = 0;
        u32 mcopt1, memcheck;
@@ -1304,7 +1295,7 @@ ppc4xx_edac_probe(struct platform_device *op, const struct of_device_id *match)
                goto done;
        }
 
-       status = ppc4xx_edac_mc_init(mci, op, match, &dcr_host, mcopt1);
+       status = ppc4xx_edac_mc_init(mci, op, &dcr_host, mcopt1);
 
        if (status) {
                ppc4xx_edac_mc_printk(KERN_ERR, mci,
@@ -1421,7 +1412,7 @@ ppc4xx_edac_init(void)
 
        ppc4xx_edac_opstate_init();
 
-       return of_register_platform_driver(&ppc4xx_edac_driver);
+       return platform_driver_register(&ppc4xx_edac_driver);
 }
 
 /**
@@ -1434,7 +1425,7 @@ ppc4xx_edac_init(void)
 static void __exit
 ppc4xx_edac_exit(void)
 {
-       of_unregister_platform_driver(&ppc4xx_edac_driver);
+       platform_driver_unregister(&ppc4xx_edac_driver);
 }
 
 module_init(ppc4xx_edac_init);
index d863e13a50b8a8a7dfb8339e64ad19cc060404ba..1f36c635d93341727c26976daedcd0c953e5b6ad 100644 (file)
@@ -234,8 +234,7 @@ static const struct attribute_group env_group = {
        .attrs = env_attributes,
 };
 
-static int __devinit env_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit env_probe(struct platform_device *op)
 {
        struct env *p = kzalloc(sizeof(*p), GFP_KERNEL);
        int err = -ENOMEM;
@@ -299,7 +298,7 @@ static const struct of_device_id env_match[] = {
 };
 MODULE_DEVICE_TABLE(of, env_match);
 
-static struct of_platform_driver env_driver = {
+static struct platform_driver env_driver = {
        .driver = {
                .name = "ultra45_env",
                .owner = THIS_MODULE,
@@ -311,12 +310,12 @@ static struct of_platform_driver env_driver = {
 
 static int __init env_init(void)
 {
-       return of_register_platform_driver(&env_driver);
+       return platform_driver_register(&env_driver);
 }
 
 static void __exit env_exit(void)
 {
-       of_unregister_platform_driver(&env_driver);
+       platform_driver_unregister(&env_driver);
 }
 
 module_init(env_init);
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 8e130bf7d32b9de5bb0da6158f7fa0bf31761911..0122f5351577735cca7d5b1347284f706dd4990d 100644 (file)
@@ -173,18 +173,16 @@ static int __devinit sparcspkr_probe(struct device *dev)
        return 0;
 }
 
-static int sparcspkr_shutdown(struct platform_device *dev)
+static void sparcspkr_shutdown(struct platform_device *dev)
 {
        struct sparcspkr_state *state = dev_get_drvdata(&dev->dev);
        struct input_dev *input_dev = state->input_dev;
 
        /* turn off the speaker */
        state->event(input_dev, EV_SND, SND_BELL, 0);
-
-       return 0;
 }
 
-static int __devinit bbc_beep_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit bbc_beep_probe(struct platform_device *op)
 {
        struct sparcspkr_state *state;
        struct bbc_beep_info *info;
@@ -258,7 +256,7 @@ static const struct of_device_id bbc_beep_match[] = {
        {},
 };
 
-static struct of_platform_driver bbc_beep_driver = {
+static struct platform_driver bbc_beep_driver = {
        .driver = {
                .name = "bbcbeep",
                .owner = THIS_MODULE,
@@ -269,7 +267,7 @@ static struct of_platform_driver bbc_beep_driver = {
        .shutdown       = sparcspkr_shutdown,
 };
 
-static int __devinit grover_beep_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit grover_beep_probe(struct platform_device *op)
 {
        struct sparcspkr_state *state;
        struct grover_beep_info *info;
@@ -340,7 +338,7 @@ static const struct of_device_id grover_beep_match[] = {
        {},
 };
 
-static struct of_platform_driver grover_beep_driver = {
+static struct platform_driver grover_beep_driver = {
        .driver = {
                .name = "groverbeep",
                .owner = THIS_MODULE,
@@ -353,12 +351,12 @@ static struct of_platform_driver grover_beep_driver = {
 
 static int __init sparcspkr_init(void)
 {
-       int err = of_register_platform_driver(&bbc_beep_driver);
+       int err = platform_driver_register(&bbc_beep_driver);
 
        if (!err) {
-               err = of_register_platform_driver(&grover_beep_driver);
+               err = platform_driver_register(&grover_beep_driver);
                if (err)
-                       of_unregister_platform_driver(&bbc_beep_driver);
+                       platform_driver_unregister(&bbc_beep_driver);
        }
 
        return err;
@@ -366,8 +364,8 @@ static int __init sparcspkr_init(void)
 
 static void __exit sparcspkr_exit(void)
 {
-       of_unregister_platform_driver(&bbc_beep_driver);
-       of_unregister_platform_driver(&grover_beep_driver);
+       platform_driver_unregister(&bbc_beep_driver);
+       platform_driver_unregister(&grover_beep_driver);
 }
 
 module_init(sparcspkr_init);
index 7998560a1904cd7f98e72d763c65c4176afb8bd4..d363dc4571a381e47efc8d1e912e0c5eca8177a1 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id altera_ps2_match[] = {
+       { .compatible = "ALTR,ps2-1.0", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+#else /* CONFIG_OF */
+#define altera_ps2_match NULL
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */
@@ -182,6 +193,7 @@ static struct platform_driver altera_ps2_driver = {
        .driver = {
                .name   = DRV_NAME,
                .owner  = THIS_MODULE,
+               .of_match_table = altera_ps2_match,
        },
 };
 
@@ -189,13 +201,12 @@ static int __init altera_ps2_init(void)
 {
        return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
        platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
index c5cc4508d6df4e55f9796ea0e6bd7ed7d8dc672f..395a9af3adcde2e4c4c1ed727eb58819fd766e6c 100644 (file)
@@ -49,7 +49,7 @@ static inline void i8042_write_command(int val)
 #define OBP_PS2MS_NAME1                "kdmouse"
 #define OBP_PS2MS_NAME2                "mouse"
 
-static int __devinit sparc_i8042_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit sparc_i8042_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
 
@@ -95,7 +95,7 @@ static const struct of_device_id sparc_i8042_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sparc_i8042_match);
 
-static struct of_platform_driver sparc_i8042_driver = {
+static struct platform_driver sparc_i8042_driver = {
        .driver = {
                .name = "i8042",
                .owner = THIS_MODULE,
@@ -116,7 +116,7 @@ static int __init i8042_platform_init(void)
                if (!kbd_iobase)
                        return -ENODEV;
        } else {
-               int err = of_register_platform_driver(&sparc_i8042_driver);
+               int err = platform_driver_register(&sparc_i8042_driver);
                if (err)
                        return err;
 
@@ -140,7 +140,7 @@ static inline void i8042_platform_exit(void)
        struct device_node *root = of_find_node_by_path("/");
 
        if (strcmp(root->name, "SUNW,JavaStation-1"))
-               of_unregister_platform_driver(&sparc_i8042_driver);
+               platform_driver_unregister(&sparc_i8042_driver);
 }
 
 #else /* !CONFIG_PCI */
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 4d9fa38d9ff6a3cffb2063823c92b0d147ce13d8..b0480c8fbcbf127c492c16cc18caf44965846a2d 100644 (file)
@@ -14,6 +14,8 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
+#include <linux/of_platform.h>
+#include <linux/of_gpio.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
@@ -151,96 +153,34 @@ static void delete_gpio_led(struct gpio_led_data *led)
        gpio_free(led->gpio);
 }
 
-#ifdef CONFIG_LEDS_GPIO_PLATFORM
-static int __devinit gpio_led_probe(struct platform_device *pdev)
-{
-       struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
-       struct gpio_led_data *leds_data;
-       int i, ret = 0;
-
-       if (!pdata)
-               return -EBUSY;
-
-       leds_data = kzalloc(sizeof(struct gpio_led_data) * pdata->num_leds,
-                               GFP_KERNEL);
-       if (!leds_data)
-               return -ENOMEM;
-
-       for (i = 0; i < pdata->num_leds; i++) {
-               ret = create_gpio_led(&pdata->leds[i], &leds_data[i],
-                                     &pdev->dev, pdata->gpio_blink_set);
-               if (ret < 0)
-                       goto err;
-       }
-
-       platform_set_drvdata(pdev, leds_data);
-
-       return 0;
-
-err:
-       for (i = i - 1; i >= 0; i--)
-               delete_gpio_led(&leds_data[i]);
-
-       kfree(leds_data);
-
-       return ret;
-}
+struct gpio_leds_priv {
+       int num_leds;
+       struct gpio_led_data leds[];
+};
 
-static int __devexit gpio_led_remove(struct platform_device *pdev)
+static inline int sizeof_gpio_leds_priv(int num_leds)
 {
-       int i;
-       struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
-       struct gpio_led_data *leds_data;
-
-       leds_data = platform_get_drvdata(pdev);
-
-       for (i = 0; i < pdata->num_leds; i++)
-               delete_gpio_led(&leds_data[i]);
-
-       kfree(leds_data);
-
-       return 0;
+       return sizeof(struct gpio_leds_priv) +
+               (sizeof(struct gpio_led_data) * num_leds);
 }
 
-static struct platform_driver gpio_led_driver = {
-       .probe          = gpio_led_probe,
-       .remove         = __devexit_p(gpio_led_remove),
-       .driver         = {
-               .name   = "leds-gpio",
-               .owner  = THIS_MODULE,
-       },
-};
-
-MODULE_ALIAS("platform:leds-gpio");
-#endif /* CONFIG_LEDS_GPIO_PLATFORM */
-
 /* Code to create from OpenFirmware platform devices */
 #ifdef CONFIG_LEDS_GPIO_OF
-#include <linux/of_platform.h>
-#include <linux/of_gpio.h>
-
-struct gpio_led_of_platform_data {
-       int num_leds;
-       struct gpio_led_data led_data[];
-};
-
-static int __devinit of_gpio_leds_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *match)
+static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev)
 {
-       struct device_node *np = ofdev->dev.of_node, *child;
-       struct gpio_led_of_platform_data *pdata;
+       struct device_node *np = pdev->dev.of_node, *child;
+       struct gpio_leds_priv *priv;
        int count = 0, ret;
 
-       /* count LEDs defined by this device, so we know how much to allocate */
+       /* count LEDs in this device, so we know how much to allocate */
        for_each_child_of_node(np, child)
                count++;
        if (!count)
-               return 0; /* or ENODEV? */
+               return NULL;
 
-       pdata = kzalloc(sizeof(*pdata) + sizeof(struct gpio_led_data) * count,
-                       GFP_KERNEL);
-       if (!pdata)
-               return -ENOMEM;
+       priv = kzalloc(sizeof_gpio_leds_priv(count), GFP_KERNEL);
+       if (!priv)
+               return NULL;
 
        for_each_child_of_node(np, child) {
                struct gpio_led led = {};
@@ -256,92 +196,112 @@ static int __devinit of_gpio_leds_probe(struct platform_device *ofdev,
                if (state) {
                        if (!strcmp(state, "keep"))
                                led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
-                       else if(!strcmp(state, "on"))
+                       else if (!strcmp(state, "on"))
                                led.default_state = LEDS_GPIO_DEFSTATE_ON;
                        else
                                led.default_state = LEDS_GPIO_DEFSTATE_OFF;
                }
 
-               ret = create_gpio_led(&led, &pdata->led_data[pdata->num_leds++],
-                                     &ofdev->dev, NULL);
+               ret = create_gpio_led(&led, &priv->leds[priv->num_leds++],
+                                     &pdev->dev, NULL);
                if (ret < 0) {
                        of_node_put(child);
                        goto err;
                }
        }
 
-       dev_set_drvdata(&ofdev->dev, pdata);
-
-       return 0;
+       return priv;
 
 err:
-       for (count = pdata->num_leds - 2; count >= 0; count--)
-               delete_gpio_led(&pdata->led_data[count]);
+       for (count = priv->num_leds - 2; count >= 0; count--)
+               delete_gpio_led(&priv->leds[count]);
+       kfree(priv);
+       return NULL;
+}
 
-       kfree(pdata);
+static const struct of_device_id of_gpio_leds_match[] = {
+       { .compatible = "gpio-leds", },
+       {},
+};
+#else
+static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev)
+{
+       return NULL;
+}
+#define of_gpio_leds_match NULL
+#endif
 
-       return ret;
+
+static int __devinit gpio_led_probe(struct platform_device *pdev)
+{
+       struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
+       struct gpio_leds_priv *priv;
+       int i, ret = 0;
+
+       if (pdata && pdata->num_leds) {
+               priv = kzalloc(sizeof_gpio_leds_priv(pdata->num_leds),
+                               GFP_KERNEL);
+               if (!priv)
+                       return -ENOMEM;
+
+               priv->num_leds = pdata->num_leds;
+               for (i = 0; i < priv->num_leds; i++) {
+                       ret = create_gpio_led(&pdata->leds[i],
+                                             &priv->leds[i],
+                                             &pdev->dev, pdata->gpio_blink_set);
+                       if (ret < 0) {
+                               /* On failure: unwind the led creations */
+                               for (i = i - 1; i >= 0; i--)
+                                       delete_gpio_led(&priv->leds[i]);
+                               kfree(priv);
+                               return ret;
+                       }
+               }
+       } else {
+               priv = gpio_leds_create_of(pdev);
+               if (!priv)
+                       return -ENODEV;
+       }
+
+       platform_set_drvdata(pdev, priv);
+
+       return 0;
 }
 
-static int __devexit of_gpio_leds_remove(struct platform_device *ofdev)
+static int __devexit gpio_led_remove(struct platform_device *pdev)
 {
-       struct gpio_led_of_platform_data *pdata = dev_get_drvdata(&ofdev->dev);
+       struct gpio_leds_priv *priv = dev_get_drvdata(&pdev->dev);
        int i;
 
-       for (i = 0; i < pdata->num_leds; i++)
-               delete_gpio_led(&pdata->led_data[i]);
-
-       kfree(pdata);
+       for (i = 0; i < priv->num_leds; i++)
+               delete_gpio_led(&priv->leds[i]);
 
-       dev_set_drvdata(&ofdev->dev, NULL);
+       dev_set_drvdata(&pdev->dev, NULL);
+       kfree(priv);
 
        return 0;
 }
 
-static const struct of_device_id of_gpio_leds_match[] = {
-       { .compatible = "gpio-leds", },
-       {},
-};
-
-static struct of_platform_driver of_gpio_leds_driver = {
-       .driver = {
-               .name = "of_gpio_leds",
-               .owner = THIS_MODULE,
+static struct platform_driver gpio_led_driver = {
+       .probe          = gpio_led_probe,
+       .remove         = __devexit_p(gpio_led_remove),
+       .driver         = {
+               .name   = "leds-gpio",
+               .owner  = THIS_MODULE,
                .of_match_table = of_gpio_leds_match,
        },
-       .probe = of_gpio_leds_probe,
-       .remove = __devexit_p(of_gpio_leds_remove),
 };
-#endif
+
+MODULE_ALIAS("platform:leds-gpio");
 
 static int __init gpio_led_init(void)
 {
-       int ret = 0;
-
-#ifdef CONFIG_LEDS_GPIO_PLATFORM       
-       ret = platform_driver_register(&gpio_led_driver);
-       if (ret)
-               return ret;
-#endif
-#ifdef CONFIG_LEDS_GPIO_OF
-       ret = of_register_platform_driver(&of_gpio_leds_driver);
-#endif
-#ifdef CONFIG_LEDS_GPIO_PLATFORM       
-       if (ret)
-               platform_driver_unregister(&gpio_led_driver);
-#endif
-
-       return ret;
+       return platform_driver_register(&gpio_led_driver);
 }
 
 static void __exit gpio_led_exit(void)
 {
-#ifdef CONFIG_LEDS_GPIO_PLATFORM
        platform_driver_unregister(&gpio_led_driver);
-#endif
-#ifdef CONFIG_LEDS_GPIO_OF
-       of_unregister_platform_driver(&of_gpio_leds_driver);
-#endif
 }
 
 module_init(gpio_led_init);
index 290cb325a94c8b48becedab2ffe9e363aa4dd7fa..116a49ce74b205285a04b7ff1808b7cc677a446b 100644 (file)
@@ -645,8 +645,7 @@ static void smu_expose_childs(struct work_struct *unused)
 
 static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs);
 
-static int smu_platform_probe(struct platform_device* dev,
-                             const struct of_device_id *match)
+static int smu_platform_probe(struct platform_device* dev)
 {
        if (!smu)
                return -ENODEV;
@@ -669,7 +668,7 @@ static const struct of_device_id smu_platform_match[] =
        {},
 };
 
-static struct of_platform_driver smu_of_platform_driver =
+static struct platform_driver smu_of_platform_driver =
 {
        .driver = {
                .name = "smu",
@@ -689,7 +688,7 @@ static int __init smu_init_sysfs(void)
         * I'm a bit too far from figuring out how that works with those
         * new chipsets, but that will come back and bite us
         */
-       of_register_platform_driver(&smu_of_platform_driver);
+       platform_driver_register(&smu_of_platform_driver);
        return 0;
 }
 
index f3a29f264db9d6ca9624e8b18b21a8a67607728a..bca2af2e3760056648acf448972da91fd78b3b60 100644 (file)
@@ -2210,7 +2210,7 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
        }
 }
 
-static int fcu_of_probe(struct platform_device* dev, const struct of_device_id *match)
+static int fcu_of_probe(struct platform_device* dev)
 {
        state = state_detached;
        of_dev = dev;
@@ -2240,7 +2240,7 @@ static const struct of_device_id fcu_match[] =
 };
 MODULE_DEVICE_TABLE(of, fcu_match);
 
-static struct of_platform_driver fcu_of_platform_driver = 
+static struct platform_driver fcu_of_platform_driver = 
 {
        .driver = {
                .name = "temperature",
@@ -2263,12 +2263,12 @@ static int __init therm_pm72_init(void)
            !rackmac)
                return -ENODEV;
 
-       return of_register_platform_driver(&fcu_of_platform_driver);
+       return platform_driver_register(&fcu_of_platform_driver);
 }
 
 static void __exit therm_pm72_exit(void)
 {
-       of_unregister_platform_driver(&fcu_of_platform_driver);
+       platform_driver_unregister(&fcu_of_platform_driver);
 }
 
 module_init(therm_pm72_init);
index c89f396e4c53d418fd15cf1d6078c7ddb9f71975..d37819fd5ad31e2d5f9341f74a950ec20847d4d8 100644 (file)
@@ -443,8 +443,7 @@ static struct i2c_driver g4fan_driver = {
 /*     initialization / cleanup                                        */
 /************************************************************************/
 
-static int
-therm_of_probe( struct platform_device *dev, const struct of_device_id *match )
+static int therm_of_probe(struct platform_device *dev)
 {
        return i2c_add_driver( &g4fan_driver );
 }
@@ -462,7 +461,7 @@ static const struct of_device_id therm_of_match[] = {{
     }, {}
 };
 
-static struct of_platform_driver therm_of_driver = {
+static struct platform_driver therm_of_driver = {
        .driver = {
                .name = "temperature",
                .owner = THIS_MODULE,
@@ -509,14 +508,14 @@ g4fan_init( void )
                return -ENODEV;
        }
 
-       of_register_platform_driver( &therm_of_driver );
+       platform_driver_register( &therm_of_driver );
        return 0;
 }
 
 static void __exit
 g4fan_exit( void )
 {
-       of_unregister_platform_driver( &therm_of_driver );
+       platform_driver_unregister( &therm_of_driver );
 
        if( x.of_dev )
                of_device_unregister( x.of_dev );
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 312b9c8f4f3bdbcb5342b4aae732bde2a3307c70..c0a1bc5b14352288d5c73238031547e4afd9ee98 100644 (file)
@@ -247,10 +247,9 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
 }
 #endif /* CONFIG_PPC_MPC512x */
 
-static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
-                                      const struct of_device_id *id)
+static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
 {
-       struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
+       struct mpc5xxx_can_data *data;
        struct device_node *np = ofdev->dev.of_node;
        struct net_device *dev;
        struct mscan_priv *priv;
@@ -259,6 +258,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
        int irq, mscan_clksrc = 0;
        int err = -ENOMEM;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+       data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
+
        base = of_iomap(np, 0);
        if (!base) {
                dev_err(&ofdev->dev, "couldn't ioremap\n");
@@ -391,7 +394,7 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
        {},
 };
 
-static struct of_platform_driver mpc5xxx_can_driver = {
+static struct platform_driver mpc5xxx_can_driver = {
        .driver = {
                .name = "mpc5xxx_can",
                .owner = THIS_MODULE,
@@ -407,13 +410,13 @@ static struct of_platform_driver mpc5xxx_can_driver = {
 
 static int __init mpc5xxx_can_init(void)
 {
-       return of_register_platform_driver(&mpc5xxx_can_driver);
+       return platform_driver_register(&mpc5xxx_can_driver);
 }
 module_init(mpc5xxx_can_init);
 
 static void __exit mpc5xxx_can_exit(void)
 {
-       return of_unregister_platform_driver(&mpc5xxx_can_driver);
+       platform_driver_unregister(&mpc5xxx_can_driver);
 };
 module_exit(mpc5xxx_can_exit);
 
index 09c3e9db931618067156cb07621d25dee10e81e4..9793df6e3455a8774c0150a72d2270c77ab788e6 100644 (file)
@@ -87,8 +87,7 @@ static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
        return 0;
 }
 
-static int __devinit sja1000_ofp_probe(struct platform_device *ofdev,
-                                      const struct of_device_id *id)
+static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct net_device *dev;
@@ -210,7 +209,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
 };
 MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
 
-static struct of_platform_driver sja1000_ofp_driver = {
+static struct platform_driver sja1000_ofp_driver = {
        .driver = {
                .owner = THIS_MODULE,
                .name = DRV_NAME,
@@ -222,12 +221,12 @@ static struct of_platform_driver sja1000_ofp_driver = {
 
 static int __init sja1000_ofp_init(void)
 {
-       return of_register_platform_driver(&sja1000_ofp_driver);
+       return platform_driver_register(&sja1000_ofp_driver);
 }
 module_init(sja1000_ofp_init);
 
 static void __exit sja1000_ofp_exit(void)
 {
-       return of_unregister_platform_driver(&sja1000_ofp_driver);
+       return platform_driver_unregister(&sja1000_ofp_driver);
 };
 module_exit(sja1000_ofp_exit);
index 50c1213f61fe938dea1b8877d1c2dbeede6c7d2a..9f81b1ac130e4f651bff6e73c7cec441d5dfe4db 100644 (file)
@@ -840,8 +840,7 @@ static const struct net_device_ops mpc52xx_fec_netdev_ops = {
 /* OF Driver                                                                */
 /* ======================================================================== */
 
-static int __devinit
-mpc52xx_fec_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit mpc52xx_fec_probe(struct platform_device *op)
 {
        int rv;
        struct net_device *ndev;
@@ -1049,7 +1048,7 @@ static struct of_device_id mpc52xx_fec_match[] = {
 
 MODULE_DEVICE_TABLE(of, mpc52xx_fec_match);
 
-static struct of_platform_driver mpc52xx_fec_driver = {
+static struct platform_driver mpc52xx_fec_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -1073,21 +1072,21 @@ mpc52xx_fec_init(void)
 {
 #ifdef CONFIG_FEC_MPC52xx_MDIO
        int ret;
-       ret = of_register_platform_driver(&mpc52xx_fec_mdio_driver);
+       ret = platform_driver_register(&mpc52xx_fec_mdio_driver);
        if (ret) {
                printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n");
                return ret;
        }
 #endif
-       return of_register_platform_driver(&mpc52xx_fec_driver);
+       return platform_driver_register(&mpc52xx_fec_driver);
 }
 
 static void __exit
 mpc52xx_fec_exit(void)
 {
-       of_unregister_platform_driver(&mpc52xx_fec_driver);
+       platform_driver_unregister(&mpc52xx_fec_driver);
 #ifdef CONFIG_FEC_MPC52xx_MDIO
-       of_unregister_platform_driver(&mpc52xx_fec_mdio_driver);
+       platform_driver_unregister(&mpc52xx_fec_mdio_driver);
 #endif
 }
 
index a227a525bdbb61e168a7fa47ab55e4118ab65eb0..41d2dffde55b2cd644f7b267d2833e9565265a5a 100644 (file)
@@ -289,6 +289,6 @@ struct mpc52xx_fec {
 #define FEC_XMIT_FSM_ENABLE_CRC                0x01000000
 
 
-extern struct of_platform_driver mpc52xx_fec_mdio_driver;
+extern struct platform_driver mpc52xx_fec_mdio_driver;
 
 #endif /* __DRIVERS_NET_MPC52XX_FEC_H__ */
index 0b4cb6f1598443cb566fae02279a3e45a455dc5c..360a578c2bb7feffb7e36592a4750f577574fd52 100644 (file)
@@ -61,8 +61,7 @@ static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int reg,
                data | FEC_MII_WRITE_FRAME);
 }
 
-static int mpc52xx_fec_mdio_probe(struct platform_device *of,
-               const struct of_device_id *match)
+static int mpc52xx_fec_mdio_probe(struct platform_device *of)
 {
        struct device *dev = &of->dev;
        struct device_node *np = of->dev.of_node;
@@ -145,7 +144,7 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match);
 
-struct of_platform_driver mpc52xx_fec_mdio_driver = {
+struct platform_driver mpc52xx_fec_mdio_driver = {
        .driver = {
                .name = "mpc5200b-fec-phy",
                .owner = THIS_MODULE,
index 7a1f3d0ffa789918b75419741824b24fd84e4e10..24cb953900dde794e60fe3d5921c7e0698f800e8 100644 (file)
@@ -998,8 +998,7 @@ static const struct net_device_ops fs_enet_netdev_ops = {
 #endif
 };
 
-static int __devinit fs_enet_probe(struct platform_device *ofdev,
-                                   const struct of_device_id *match)
+static int __devinit fs_enet_probe(struct platform_device *ofdev)
 {
        struct net_device *ndev;
        struct fs_enet_private *fep;
@@ -1008,11 +1007,14 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
        const u8 *mac_addr;
        int privsize, len, ret = -ENODEV;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+
        fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
        if (!fpi)
                return -ENOMEM;
 
-       if (!IS_FEC(match)) {
+       if (!IS_FEC(ofdev->dev.of_match)) {
                data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
                if (!data || len != 4)
                        goto out_free_fpi;
@@ -1047,7 +1049,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
        fep->dev = &ofdev->dev;
        fep->ndev = ndev;
        fep->fpi = fpi;
-       fep->ops = match->data;
+       fep->ops = ofdev->dev.of_match->data;
 
        ret = fep->ops->setup_data(ndev);
        if (ret)
@@ -1156,7 +1158,7 @@ static struct of_device_id fs_enet_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fs_enet_match);
 
-static struct of_platform_driver fs_enet_driver = {
+static struct platform_driver fs_enet_driver = {
        .driver = {
                .owner = THIS_MODULE,
                .name = "fs_enet",
@@ -1168,12 +1170,12 @@ static struct of_platform_driver fs_enet_driver = {
 
 static int __init fs_init(void)
 {
-       return of_register_platform_driver(&fs_enet_driver);
+       return platform_driver_register(&fs_enet_driver);
 }
 
 static void __exit fs_cleanup(void)
 {
-       of_unregister_platform_driver(&fs_enet_driver);
+       platform_driver_unregister(&fs_enet_driver);
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
index 3cda2b515471e83ca8cde7b1c5c26f9701b43f01..ad2975440719fd168b1da705adf061d04190bd45 100644 (file)
@@ -150,8 +150,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
        return 0;
 }
 
-static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev,
-                                        const struct of_device_id *match)
+static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
 {
        struct mii_bus *new_bus;
        struct bb_info *bitbang;
@@ -223,7 +222,7 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
 
-static struct of_platform_driver fs_enet_bb_mdio_driver = {
+static struct platform_driver fs_enet_bb_mdio_driver = {
        .driver = {
                .name = "fsl-bb-mdio",
                .owner = THIS_MODULE,
@@ -235,12 +234,12 @@ static struct of_platform_driver fs_enet_bb_mdio_driver = {
 
 static int fs_enet_mdio_bb_init(void)
 {
-       return of_register_platform_driver(&fs_enet_bb_mdio_driver);
+       return platform_driver_register(&fs_enet_bb_mdio_driver);
 }
 
 static void fs_enet_mdio_bb_exit(void)
 {
-       of_unregister_platform_driver(&fs_enet_bb_mdio_driver);
+       platform_driver_unregister(&fs_enet_bb_mdio_driver);
 }
 
 module_init(fs_enet_mdio_bb_init);
index dbb9c48623dfbad9b5b6e36b39c7308295e95ee8..7e840d373ab36b73fce7676684a1110056ccb4b5 100644 (file)
@@ -101,15 +101,18 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus)
        return 0;
 }
 
-static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev,
-                                        const struct of_device_id *match)
+static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
 {
        struct resource res;
        struct mii_bus *new_bus;
        struct fec_info *fec;
-       int (*get_bus_freq)(struct device_node *) = match->data;
+       int (*get_bus_freq)(struct device_node *);
        int ret = -ENOMEM, clock, speed;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+       get_bus_freq = ofdev->dev.of_match->data;
+
        new_bus = mdiobus_alloc();
        if (!new_bus)
                goto out;
@@ -221,7 +224,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
 
-static struct of_platform_driver fs_enet_fec_mdio_driver = {
+static struct platform_driver fs_enet_fec_mdio_driver = {
        .driver = {
                .name = "fsl-fec-mdio",
                .owner = THIS_MODULE,
@@ -233,12 +236,12 @@ static struct of_platform_driver fs_enet_fec_mdio_driver = {
 
 static int fs_enet_mdio_fec_init(void)
 {
-       return of_register_platform_driver(&fs_enet_fec_mdio_driver);
+       return platform_driver_register(&fs_enet_fec_mdio_driver);
 }
 
 static void fs_enet_mdio_fec_exit(void)
 {
-       of_unregister_platform_driver(&fs_enet_fec_mdio_driver);
+       platform_driver_unregister(&fs_enet_fec_mdio_driver);
 }
 
 module_init(fs_enet_mdio_fec_init);
index 8d3a2ccbc953e39879c88ebd2d80d92211c2b792..52f4e8ad48e77c84b8bd4ed9cd52faa3f5adb419 100644 (file)
@@ -265,8 +265,7 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
 #endif
 
 
-static int fsl_pq_mdio_probe(struct platform_device *ofdev,
-               const struct of_device_id *match)
+static int fsl_pq_mdio_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct device_node *tbi;
@@ -471,7 +470,7 @@ static struct of_device_id fsl_pq_mdio_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
 
-static struct of_platform_driver fsl_pq_mdio_driver = {
+static struct platform_driver fsl_pq_mdio_driver = {
        .driver = {
                .name = "fsl-pq_mdio",
                .owner = THIS_MODULE,
@@ -483,13 +482,13 @@ static struct of_platform_driver fsl_pq_mdio_driver = {
 
 int __init fsl_pq_mdio_init(void)
 {
-       return of_register_platform_driver(&fsl_pq_mdio_driver);
+       return platform_driver_register(&fsl_pq_mdio_driver);
 }
 module_init(fsl_pq_mdio_init);
 
 void fsl_pq_mdio_exit(void)
 {
-       of_unregister_platform_driver(&fsl_pq_mdio_driver);
+       platform_driver_unregister(&fsl_pq_mdio_driver);
 }
 module_exit(fsl_pq_mdio_exit);
 MODULE_LICENSE("GPL");
index 5ed8f9f9419f163c26703412bb03512537a7e966..ccb231c4d9334bbe49336eeee5f8491e0c8e321b 100644 (file)
@@ -123,8 +123,7 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id);
 static void adjust_link(struct net_device *dev);
 static void init_registers(struct net_device *dev);
 static int init_phy(struct net_device *dev);
-static int gfar_probe(struct platform_device *ofdev,
-               const struct of_device_id *match);
+static int gfar_probe(struct platform_device *ofdev);
 static int gfar_remove(struct platform_device *ofdev);
 static void free_skb_resources(struct gfar_private *priv);
 static void gfar_set_multi(struct net_device *dev);
@@ -957,8 +956,7 @@ static void gfar_detect_errata(struct gfar_private *priv)
 
 /* Set up the ethernet device structure, private data,
  * and anything else we need before we start */
-static int gfar_probe(struct platform_device *ofdev,
-               const struct of_device_id *match)
+static int gfar_probe(struct platform_device *ofdev)
 {
        u32 tempval;
        struct net_device *dev = NULL;
@@ -3256,7 +3254,7 @@ static struct of_device_id gfar_match[] =
 MODULE_DEVICE_TABLE(of, gfar_match);
 
 /* Structure for a device driver */
-static struct of_platform_driver gfar_driver = {
+static struct platform_driver gfar_driver = {
        .driver = {
                .name = "fsl-gianfar",
                .owner = THIS_MODULE,
@@ -3269,12 +3267,12 @@ static struct of_platform_driver gfar_driver = {
 
 static int __init gfar_init(void)
 {
-       return of_register_platform_driver(&gfar_driver);
+       return platform_driver_register(&gfar_driver);
 }
 
 static void __exit gfar_exit(void)
 {
-       of_unregister_platform_driver(&gfar_driver);
+       platform_driver_unregister(&gfar_driver);
 }
 
 module_init(gfar_init);
index fdb0333f5cb60145bdeb2ec9940b85a319d14cad..396ff7d785d16aa3a16ff47fcbdda81c97799e80 100644 (file)
@@ -1411,7 +1411,7 @@ error:
 }
 
 /* Initialize the GRETH MAC */
-static int __devinit greth_of_probe(struct platform_device *ofdev, const struct of_device_id *match)
+static int __devinit greth_of_probe(struct platform_device *ofdev)
 {
        struct net_device *dev;
        struct greth_private *greth;
@@ -1646,7 +1646,7 @@ static struct of_device_id greth_of_match[] = {
 
 MODULE_DEVICE_TABLE(of, greth_of_match);
 
-static struct of_platform_driver greth_of_driver = {
+static struct platform_driver greth_of_driver = {
        .driver = {
                .name = "grlib-greth",
                .owner = THIS_MODULE,
@@ -1658,12 +1658,12 @@ static struct of_platform_driver greth_of_driver = {
 
 static int __init greth_init(void)
 {
-       return of_register_platform_driver(&greth_of_driver);
+       return platform_driver_register(&greth_of_driver);
 }
 
 static void __exit greth_cleanup(void)
 {
-       of_unregister_platform_driver(&greth_of_driver);
+       platform_driver_unregister(&greth_of_driver);
 }
 
 module_init(greth_init);
index 6d9275c52e057d7348af153620bccf7ed8984a9e..3bb990b6651afb248c478639a60fecadb0af8608 100644 (file)
@@ -2719,8 +2719,7 @@ static const struct net_device_ops emac_gige_netdev_ops = {
        .ndo_change_mtu         = emac_change_mtu,
 };
 
-static int __devinit emac_probe(struct platform_device *ofdev,
-                               const struct of_device_id *match)
+static int __devinit emac_probe(struct platform_device *ofdev)
 {
        struct net_device *ndev;
        struct emac_instance *dev;
@@ -2994,7 +2993,7 @@ static struct of_device_id emac_match[] =
 };
 MODULE_DEVICE_TABLE(of, emac_match);
 
-static struct of_platform_driver emac_driver = {
+static struct platform_driver emac_driver = {
        .driver = {
                .name = "emac",
                .owner = THIS_MODULE,
@@ -3069,7 +3068,7 @@ static int __init emac_init(void)
        rc = tah_init();
        if (rc)
                goto err_rgmii;
-       rc = of_register_platform_driver(&emac_driver);
+       rc = platform_driver_register(&emac_driver);
        if (rc)
                goto err_tah;
 
@@ -3091,7 +3090,7 @@ static void __exit emac_exit(void)
 {
        int i;
 
-       of_unregister_platform_driver(&emac_driver);
+       platform_driver_unregister(&emac_driver);
 
        tah_exit();
        rgmii_exit();
index d5717e2123e19d421259a66096f154fe862324ec..d268f404b7b0388a97ca45944c12edf613e125cf 100644 (file)
@@ -517,8 +517,7 @@ void *mal_dump_regs(struct mal_instance *mal, void *buf)
        return regs + 1;
 }
 
-static int __devinit mal_probe(struct platform_device *ofdev,
-                              const struct of_device_id *match)
+static int __devinit mal_probe(struct platform_device *ofdev)
 {
        struct mal_instance *mal;
        int err = 0, i, bd_size;
@@ -789,7 +788,7 @@ static struct of_device_id mal_platform_match[] =
        {},
 };
 
-static struct of_platform_driver mal_of_driver = {
+static struct platform_driver mal_of_driver = {
        .driver = {
                .name = "mcmal",
                .owner = THIS_MODULE,
@@ -801,10 +800,10 @@ static struct of_platform_driver mal_of_driver = {
 
 int __init mal_init(void)
 {
-       return of_register_platform_driver(&mal_of_driver);
+       return platform_driver_register(&mal_of_driver);
 }
 
 void mal_exit(void)
 {
-       of_unregister_platform_driver(&mal_of_driver);
+       platform_driver_unregister(&mal_of_driver);
 }
index dd61798897ac97957598722fe6873770204c5f08..4fa53f3def64390703f74d1579e46230a785305a 100644 (file)
@@ -228,8 +228,7 @@ void *rgmii_dump_regs(struct platform_device *ofdev, void *buf)
 }
 
 
-static int __devinit rgmii_probe(struct platform_device *ofdev,
-                                const struct of_device_id *match)
+static int __devinit rgmii_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct rgmii_instance *dev;
@@ -318,7 +317,7 @@ static struct of_device_id rgmii_match[] =
        {},
 };
 
-static struct of_platform_driver rgmii_driver = {
+static struct platform_driver rgmii_driver = {
        .driver = {
                .name = "emac-rgmii",
                .owner = THIS_MODULE,
@@ -330,10 +329,10 @@ static struct of_platform_driver rgmii_driver = {
 
 int __init rgmii_init(void)
 {
-       return of_register_platform_driver(&rgmii_driver);
+       return platform_driver_register(&rgmii_driver);
 }
 
 void rgmii_exit(void)
 {
-       of_unregister_platform_driver(&rgmii_driver);
+       platform_driver_unregister(&rgmii_driver);
 }
index 299aa49490c0cf239fda0f18d0e3a213edbb8c83..8ead6a96abaa1203474c67cd644517ef4c559a30 100644 (file)
@@ -87,8 +87,7 @@ void *tah_dump_regs(struct platform_device *ofdev, void *buf)
        return regs + 1;
 }
 
-static int __devinit tah_probe(struct platform_device *ofdev,
-                              const struct of_device_id *match)
+static int __devinit tah_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct tah_instance *dev;
@@ -165,7 +164,7 @@ static struct of_device_id tah_match[] =
        {},
 };
 
-static struct of_platform_driver tah_driver = {
+static struct platform_driver tah_driver = {
        .driver = {
                .name = "emac-tah",
                .owner = THIS_MODULE,
@@ -177,10 +176,10 @@ static struct of_platform_driver tah_driver = {
 
 int __init tah_init(void)
 {
-       return of_register_platform_driver(&tah_driver);
+       return platform_driver_register(&tah_driver);
 }
 
 void tah_exit(void)
 {
-       of_unregister_platform_driver(&tah_driver);
+       platform_driver_unregister(&tah_driver);
 }
index 34ed6ee8ca8a415e43e3607791b4bc986d10016e..97449e786d61545a5ddef11cba01a2badea51270 100644 (file)
@@ -231,8 +231,7 @@ void *zmii_dump_regs(struct platform_device *ofdev, void *buf)
        return regs + 1;
 }
 
-static int __devinit zmii_probe(struct platform_device *ofdev,
-                               const struct of_device_id *match)
+static int __devinit zmii_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct zmii_instance *dev;
@@ -312,7 +311,7 @@ static struct of_device_id zmii_match[] =
        {},
 };
 
-static struct of_platform_driver zmii_driver = {
+static struct platform_driver zmii_driver = {
        .driver = {
                .name = "emac-zmii",
                .owner = THIS_MODULE,
@@ -324,10 +323,10 @@ static struct of_platform_driver zmii_driver = {
 
 int __init zmii_init(void)
 {
-       return of_register_platform_driver(&zmii_driver);
+       return platform_driver_register(&zmii_driver);
 }
 
 void zmii_exit(void)
 {
-       of_unregister_platform_driver(&zmii_driver);
+       platform_driver_unregister(&zmii_driver);
 }
index f35554d11441454474b531aa7a2d7dd0c535e562..b7948ccfcf7d4e4f2d51d724d7a32057767b9e20 100644 (file)
@@ -952,8 +952,7 @@ static const struct attribute_group temac_attr_group = {
        .attrs = temac_device_attrs,
 };
 
-static int __devinit
-temac_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit temac_of_probe(struct platform_device *op)
 {
        struct device_node *np;
        struct temac_local *lp;
@@ -1123,7 +1122,7 @@ static struct of_device_id temac_of_match[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(of, temac_of_match);
 
-static struct of_platform_driver temac_of_driver = {
+static struct platform_driver temac_of_driver = {
        .probe = temac_of_probe,
        .remove = __devexit_p(temac_of_remove),
        .driver = {
@@ -1135,13 +1134,13 @@ static struct of_platform_driver temac_of_driver = {
 
 static int __init temac_init(void)
 {
-       return of_register_platform_driver(&temac_of_driver);
+       return platform_driver_register(&temac_of_driver);
 }
 module_init(temac_init);
 
 static void __exit temac_exit(void)
 {
-       of_unregister_platform_driver(&temac_of_driver);
+       platform_driver_unregister(&temac_of_driver);
 }
 module_exit(temac_exit);
 
index 4846e131a04e8c4edc609764595523e8bffcebe0..a761076b69c39c6bc32b9683ad5aaf5aac447cb8 100644 (file)
@@ -926,7 +926,7 @@ static const struct net_device_ops myri_ops = {
        .ndo_validate_addr      = eth_validate_addr,
 };
 
-static int __devinit myri_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit myri_sbus_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        static unsigned version_printed;
@@ -1160,7 +1160,7 @@ static const struct of_device_id myri_sbus_match[] = {
 
 MODULE_DEVICE_TABLE(of, myri_sbus_match);
 
-static struct of_platform_driver myri_sbus_driver = {
+static struct platform_driver myri_sbus_driver = {
        .driver = {
                .name = "myri",
                .owner = THIS_MODULE,
@@ -1172,12 +1172,12 @@ static struct of_platform_driver myri_sbus_driver = {
 
 static int __init myri_sbus_init(void)
 {
-       return of_register_platform_driver(&myri_sbus_driver);
+       return platform_driver_register(&myri_sbus_driver);
 }
 
 static void __exit myri_sbus_exit(void)
 {
-       of_unregister_platform_driver(&myri_sbus_driver);
+       platform_driver_unregister(&myri_sbus_driver);
 }
 
 module_init(myri_sbus_init);
index 9fb59d3f9c9275e7a222fc40934ac815b9cdb3cd..40fa59e2fd5c65aa973e688b87cb3e9251d2d435 100644 (file)
@@ -10062,8 +10062,7 @@ static const struct niu_ops niu_phys_ops = {
        .unmap_single   = niu_phys_unmap_single,
 };
 
-static int __devinit niu_of_probe(struct platform_device *op,
-                                 const struct of_device_id *match)
+static int __devinit niu_of_probe(struct platform_device *op)
 {
        union niu_parent_id parent_id;
        struct net_device *dev;
@@ -10223,7 +10222,7 @@ static const struct of_device_id niu_match[] = {
 };
 MODULE_DEVICE_TABLE(of, niu_match);
 
-static struct of_platform_driver niu_of_driver = {
+static struct platform_driver niu_of_driver = {
        .driver = {
                .name = "niu",
                .owner = THIS_MODULE,
@@ -10244,14 +10243,14 @@ static int __init niu_init(void)
        niu_debug = netif_msg_init(debug, NIU_MSG_DEFAULT);
 
 #ifdef CONFIG_SPARC64
-       err = of_register_platform_driver(&niu_of_driver);
+       err = platform_driver_register(&niu_of_driver);
 #endif
 
        if (!err) {
                err = pci_register_driver(&niu_pci_driver);
 #ifdef CONFIG_SPARC64
                if (err)
-                       of_unregister_platform_driver(&niu_of_driver);
+                       platform_driver_unregister(&niu_of_driver);
 #endif
        }
 
@@ -10262,7 +10261,7 @@ static void __exit niu_exit(void)
 {
        pci_unregister_driver(&niu_pci_driver);
 #ifdef CONFIG_SPARC64
-       of_unregister_platform_driver(&niu_of_driver);
+       platform_driver_unregister(&niu_of_driver);
 #endif
 }
 
index f62c7b717bc88e18a346da6d9390c612dacd5d44..47c8339a03595cb645c672fc262b76db4bf6cffb 100644 (file)
@@ -188,8 +188,7 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev)
 
 #ifdef CONFIG_OF_GPIO
 
-static int __devinit mdio_ofgpio_probe(struct platform_device *ofdev,
-                                        const struct of_device_id *match)
+static int __devinit mdio_ofgpio_probe(struct platform_device *ofdev)
 {
        struct mdio_gpio_platform_data *pdata;
        struct mii_bus *new_bus;
@@ -240,7 +239,7 @@ static struct of_device_id mdio_ofgpio_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mdio_ofgpio_match);
 
-static struct of_platform_driver mdio_ofgpio_driver = {
+static struct platform_driver mdio_ofgpio_driver = {
        .driver = {
                .name = "mdio-gpio",
                .owner = THIS_MODULE,
@@ -252,12 +251,12 @@ static struct of_platform_driver mdio_ofgpio_driver = {
 
 static inline int __init mdio_ofgpio_init(void)
 {
-       return of_register_platform_driver(&mdio_ofgpio_driver);
+       return platform_driver_register(&mdio_ofgpio_driver);
 }
 
 static inline void __exit mdio_ofgpio_exit(void)
 {
-       of_unregister_platform_driver(&mdio_ofgpio_driver);
+       platform_driver_unregister(&mdio_ofgpio_driver);
 }
 #else
 static inline int __init mdio_ofgpio_init(void) { return 0; }
index 0a6a5ced3c1cc88d71f0a3fce501b6b14cebf4e3..aa4765803a4c4c9750fa7e24b9404dc1af61559e 100644 (file)
@@ -1242,8 +1242,7 @@ fail_and_cleanup:
 /* QEC can be the parent of either QuadEthernet or a BigMAC.  We want
  * the latter.
  */
-static int __devinit bigmac_sbus_probe(struct platform_device *op,
-                                      const struct of_device_id *match)
+static int __devinit bigmac_sbus_probe(struct platform_device *op)
 {
        struct device *parent = op->dev.parent;
        struct platform_device *qec_op;
@@ -1289,7 +1288,7 @@ static const struct of_device_id bigmac_sbus_match[] = {
 
 MODULE_DEVICE_TABLE(of, bigmac_sbus_match);
 
-static struct of_platform_driver bigmac_sbus_driver = {
+static struct platform_driver bigmac_sbus_driver = {
        .driver = {
                .name = "sunbmac",
                .owner = THIS_MODULE,
@@ -1301,12 +1300,12 @@ static struct of_platform_driver bigmac_sbus_driver = {
 
 static int __init bigmac_init(void)
 {
-       return of_register_platform_driver(&bigmac_sbus_driver);
+       return platform_driver_register(&bigmac_sbus_driver);
 }
 
 static void __exit bigmac_exit(void)
 {
-       of_unregister_platform_driver(&bigmac_sbus_driver);
+       platform_driver_unregister(&bigmac_sbus_driver);
 }
 
 module_init(bigmac_init);
index 55bbb9c15d96e2501039d34093f951ebad0f1294..eb4f59fb01e90cacc722a732e23ef46181747c61 100644 (file)
@@ -3237,11 +3237,15 @@ static void happy_meal_pci_exit(void)
 #endif
 
 #ifdef CONFIG_SBUS
-static int __devinit hme_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit hme_sbus_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        const char *model = of_get_property(dp, "model", NULL);
-       int is_qfe = (match->data != NULL);
+       int is_qfe;
+
+       if (!op->dev.of_match)
+               return -EINVAL;
+       is_qfe = (op->dev.of_match->data != NULL);
 
        if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))
                is_qfe = 1;
@@ -3292,7 +3296,7 @@ static const struct of_device_id hme_sbus_match[] = {
 
 MODULE_DEVICE_TABLE(of, hme_sbus_match);
 
-static struct of_platform_driver hme_sbus_driver = {
+static struct platform_driver hme_sbus_driver = {
        .driver = {
                .name = "hme",
                .owner = THIS_MODULE,
@@ -3306,7 +3310,7 @@ static int __init happy_meal_sbus_init(void)
 {
        int err;
 
-       err = of_register_platform_driver(&hme_sbus_driver);
+       err = platform_driver_register(&hme_sbus_driver);
        if (!err)
                err = quattro_sbus_register_irqs();
 
@@ -3315,7 +3319,7 @@ static int __init happy_meal_sbus_init(void)
 
 static void happy_meal_sbus_exit(void)
 {
-       of_unregister_platform_driver(&hme_sbus_driver);
+       platform_driver_unregister(&hme_sbus_driver);
        quattro_sbus_free_irqs();
 
        while (qfe_sbus_list) {
index 767e1e2b210dcd6bb3a5dfdb44f4d73451ba0835..32a5c7f63c43caa806bcb5acae6f367bf2a9f274 100644 (file)
@@ -1495,7 +1495,7 @@ fail:
        return -ENODEV;
 }
 
-static int __devinit sunlance_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit sunlance_sbus_probe(struct platform_device *op)
 {
        struct platform_device *parent = to_platform_device(op->dev.parent);
        struct device_node *parent_dp = parent->dev.of_node;
@@ -1536,7 +1536,7 @@ static const struct of_device_id sunlance_sbus_match[] = {
 
 MODULE_DEVICE_TABLE(of, sunlance_sbus_match);
 
-static struct of_platform_driver sunlance_sbus_driver = {
+static struct platform_driver sunlance_sbus_driver = {
        .driver = {
                .name = "sunlance",
                .owner = THIS_MODULE,
@@ -1550,12 +1550,12 @@ static struct of_platform_driver sunlance_sbus_driver = {
 /* Find all the lance cards on the system and initialize them */
 static int __init sparc_lance_init(void)
 {
-       return of_register_platform_driver(&sunlance_sbus_driver);
+       return platform_driver_register(&sunlance_sbus_driver);
 }
 
 static void __exit sparc_lance_exit(void)
 {
-       of_unregister_platform_driver(&sunlance_sbus_driver);
+       platform_driver_unregister(&sunlance_sbus_driver);
 }
 
 module_init(sparc_lance_init);
index 9536b2f010be7d08cba459b505473956109f605c..18ecdc303751055b63f26c20b5dfd136da32688e 100644 (file)
@@ -941,7 +941,7 @@ fail:
        return res;
 }
 
-static int __devinit qec_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit qec_sbus_probe(struct platform_device *op)
 {
        return qec_ether_init(op);
 }
@@ -976,7 +976,7 @@ static const struct of_device_id qec_sbus_match[] = {
 
 MODULE_DEVICE_TABLE(of, qec_sbus_match);
 
-static struct of_platform_driver qec_sbus_driver = {
+static struct platform_driver qec_sbus_driver = {
        .driver = {
                .name = "qec",
                .owner = THIS_MODULE,
@@ -988,12 +988,12 @@ static struct of_platform_driver qec_sbus_driver = {
 
 static int __init qec_init(void)
 {
-       return of_register_platform_driver(&qec_sbus_driver);
+       return platform_driver_register(&qec_sbus_driver);
 }
 
 static void __exit qec_exit(void)
 {
-       of_unregister_platform_driver(&qec_sbus_driver);
+       platform_driver_unregister(&qec_sbus_driver);
 
        while (root_qec_dev) {
                struct sunqec *next = root_qec_dev->next_module;
index 715e7b47e7e987ff47c502c229686911cae17bc5..ef041057d9d35c201e8c8cf830deecde0b1d8613 100644 (file)
@@ -3740,7 +3740,7 @@ static const struct net_device_ops ucc_geth_netdev_ops = {
 #endif
 };
 
-static int ucc_geth_probe(struct platform_device* ofdev, const struct of_device_id *match)
+static int ucc_geth_probe(struct platform_device* ofdev)
 {
        struct device *device = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
@@ -3986,7 +3986,7 @@ static struct of_device_id ucc_geth_match[] = {
 
 MODULE_DEVICE_TABLE(of, ucc_geth_match);
 
-static struct of_platform_driver ucc_geth_driver = {
+static struct platform_driver ucc_geth_driver = {
        .driver = {
                .name = DRV_NAME,
                .owner = THIS_MODULE,
@@ -4008,14 +4008,14 @@ static int __init ucc_geth_init(void)
                memcpy(&(ugeth_info[i]), &ugeth_primary_info,
                       sizeof(ugeth_primary_info));
 
-       ret = of_register_platform_driver(&ucc_geth_driver);
+       ret = platform_driver_register(&ucc_geth_driver);
 
        return ret;
 }
 
 static void __exit ucc_geth_exit(void)
 {
-       of_unregister_platform_driver(&ucc_geth_driver);
+       platform_driver_unregister(&ucc_geth_driver);
 }
 
 module_init(ucc_geth_init);
index cad66ce1640b97069ce25b6c8539feadd353762a..2642af4ee491ff3b4bca31adf964e7aa1923eb27 100644 (file)
@@ -1101,8 +1101,7 @@ static struct net_device_ops xemaclite_netdev_ops;
  * Return:     0, if the driver is bound to the Emaclite device, or
  *             a negative error if there is failure.
  */
-static int __devinit xemaclite_of_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *match)
+static int __devinit xemaclite_of_probe(struct platform_device *ofdev)
 {
        struct resource r_irq; /* Interrupt resources */
        struct resource r_mem; /* IO mem resources */
@@ -1288,7 +1287,7 @@ static struct of_device_id xemaclite_of_match[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(of, xemaclite_of_match);
 
-static struct of_platform_driver xemaclite_of_driver = {
+static struct platform_driver xemaclite_of_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -1306,7 +1305,7 @@ static struct of_platform_driver xemaclite_of_driver = {
 static int __init xemaclite_init(void)
 {
        /* No kernel boot options used, we just need to register the driver */
-       return of_register_platform_driver(&xemaclite_of_driver);
+       return platform_driver_register(&xemaclite_of_driver);
 }
 
 /**
@@ -1314,7 +1313,7 @@ static int __init xemaclite_init(void)
  */
 static void __exit xemaclite_cleanup(void)
 {
-       of_unregister_platform_driver(&xemaclite_of_driver);
+       platform_driver_unregister(&xemaclite_of_driver);
 }
 
 module_init(xemaclite_init);
index 45d86530799fce60e1f117dd7b55d9223f29748d..62b4b32ac8878eb13ca06ab57cc014a4ba843dfe 100644 (file)
@@ -47,40 +47,6 @@ void of_dev_put(struct platform_device *dev)
 }
 EXPORT_SYMBOL(of_dev_put);
 
-static ssize_t devspec_show(struct device *dev,
-                               struct device_attribute *attr, char *buf)
-{
-       struct platform_device *ofdev;
-
-       ofdev = to_platform_device(dev);
-       return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
-}
-
-static ssize_t name_show(struct device *dev,
-                               struct device_attribute *attr, char *buf)
-{
-       struct platform_device *ofdev;
-
-       ofdev = to_platform_device(dev);
-       return sprintf(buf, "%s\n", ofdev->dev.of_node->name);
-}
-
-static ssize_t modalias_show(struct device *dev,
-                               struct device_attribute *attr, char *buf)
-{
-       ssize_t len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2);
-       buf[len] = '\n';
-       buf[len+1] = 0;
-       return len+1;
-}
-
-struct device_attribute of_platform_device_attrs[] = {
-       __ATTR_RO(devspec),
-       __ATTR_RO(name),
-       __ATTR_RO(modalias),
-       __ATTR_NULL
-};
-
 int of_device_add(struct platform_device *ofdev)
 {
        BUG_ON(ofdev->dev.of_node == NULL);
index c01cd1ac7617d6a50596691748036c154143074a..1ce4c45c4ab2a12e431172a236fd26c1b96409ce 100644 (file)
@@ -42,471 +42,10 @@ struct platform_device *of_find_device_by_node(struct device_node *np)
 }
 EXPORT_SYMBOL(of_find_device_by_node);
 
-static int platform_driver_probe_shim(struct platform_device *pdev)
-{
-       struct platform_driver *pdrv;
-       struct of_platform_driver *ofpdrv;
-       const struct of_device_id *match;
-
-       pdrv = container_of(pdev->dev.driver, struct platform_driver, driver);
-       ofpdrv = container_of(pdrv, struct of_platform_driver, platform_driver);
-
-       /* There is an unlikely chance that an of_platform driver might match
-        * on a non-OF platform device.  If so, then of_match_device() will
-        * come up empty.  Return -EINVAL in this case so other drivers get
-        * the chance to bind. */
-       match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);
-       return match ? ofpdrv->probe(pdev, match) : -EINVAL;
-}
-
-static void platform_driver_shutdown_shim(struct platform_device *pdev)
-{
-       struct platform_driver *pdrv;
-       struct of_platform_driver *ofpdrv;
-
-       pdrv = container_of(pdev->dev.driver, struct platform_driver, driver);
-       ofpdrv = container_of(pdrv, struct of_platform_driver, platform_driver);
-       ofpdrv->shutdown(pdev);
-}
-
-/**
- * of_register_platform_driver
- */
-int of_register_platform_driver(struct of_platform_driver *drv)
-{
-       char *of_name;
-
-       /* setup of_platform_driver to platform_driver adaptors */
-       drv->platform_driver.driver = drv->driver;
-
-       /* Prefix the driver name with 'of:' to avoid namespace collisions
-        * and bogus matches.  There are some drivers in the tree that
-        * register both an of_platform_driver and a platform_driver with
-        * the same name.  This is a temporary measure until they are all
-        * cleaned up --gcl July 29, 2010 */
-       of_name = kmalloc(strlen(drv->driver.name) + 5, GFP_KERNEL);
-       if (!of_name)
-               return -ENOMEM;
-       sprintf(of_name, "of:%s", drv->driver.name);
-       drv->platform_driver.driver.name = of_name;
-
-       if (drv->probe)
-               drv->platform_driver.probe = platform_driver_probe_shim;
-       drv->platform_driver.remove = drv->remove;
-       if (drv->shutdown)
-               drv->platform_driver.shutdown = platform_driver_shutdown_shim;
-       drv->platform_driver.suspend = drv->suspend;
-       drv->platform_driver.resume = drv->resume;
-
-       return platform_driver_register(&drv->platform_driver);
-}
-EXPORT_SYMBOL(of_register_platform_driver);
-
-void of_unregister_platform_driver(struct of_platform_driver *drv)
-{
-       platform_driver_unregister(&drv->platform_driver);
-       kfree(drv->platform_driver.driver.name);
-       drv->platform_driver.driver.name = NULL;
-}
-EXPORT_SYMBOL(of_unregister_platform_driver);
-
 #if defined(CONFIG_PPC_DCR)
 #include <asm/dcr.h>
 #endif
 
-extern struct device_attribute of_platform_device_attrs[];
-
-static int of_platform_bus_match(struct device *dev, struct device_driver *drv)
-{
-       const struct of_device_id *matches = drv->of_match_table;
-
-       if (!matches)
-               return 0;
-
-       return of_match_device(matches, dev) != NULL;
-}
-
-static int of_platform_device_probe(struct device *dev)
-{
-       int error = -ENODEV;
-       struct of_platform_driver *drv;
-       struct platform_device *of_dev;
-       const struct of_device_id *match;
-
-       drv = to_of_platform_driver(dev->driver);
-       of_dev = to_platform_device(dev);
-
-       if (!drv->probe)
-               return error;
-
-       of_dev_get(of_dev);
-
-       match = of_match_device(drv->driver.of_match_table, dev);
-       if (match)
-               error = drv->probe(of_dev, match);
-       if (error)
-               of_dev_put(of_dev);
-
-       return error;
-}
-
-static int of_platform_device_remove(struct device *dev)
-{
-       struct platform_device *of_dev = to_platform_device(dev);
-       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
-
-       if (dev->driver && drv->remove)
-               drv->remove(of_dev);
-       return 0;
-}
-
-static void of_platform_device_shutdown(struct device *dev)
-{
-       struct platform_device *of_dev = to_platform_device(dev);
-       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
-
-       if (dev->driver && drv->shutdown)
-               drv->shutdown(of_dev);
-}
-
-#ifdef CONFIG_PM_SLEEP
-
-static int of_platform_legacy_suspend(struct device *dev, pm_message_t mesg)
-{
-       struct platform_device *of_dev = to_platform_device(dev);
-       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
-       int ret = 0;
-
-       if (dev->driver && drv->suspend)
-               ret = drv->suspend(of_dev, mesg);
-       return ret;
-}
-
-static int of_platform_legacy_resume(struct device *dev)
-{
-       struct platform_device *of_dev = to_platform_device(dev);
-       struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
-       int ret = 0;
-
-       if (dev->driver && drv->resume)
-               ret = drv->resume(of_dev);
-       return ret;
-}
-
-static int of_platform_pm_prepare(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (drv && drv->pm && drv->pm->prepare)
-               ret = drv->pm->prepare(dev);
-
-       return ret;
-}
-
-static void of_platform_pm_complete(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
-}
-
-#ifdef CONFIG_SUSPEND
-
-static int of_platform_pm_suspend(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->suspend)
-                       ret = drv->pm->suspend(dev);
-       } else {
-               ret = of_platform_legacy_suspend(dev, PMSG_SUSPEND);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_suspend_noirq(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->suspend_noirq)
-                       ret = drv->pm->suspend_noirq(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_resume(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->resume)
-                       ret = drv->pm->resume(dev);
-       } else {
-               ret = of_platform_legacy_resume(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_resume_noirq(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->resume_noirq)
-                       ret = drv->pm->resume_noirq(dev);
-       }
-
-       return ret;
-}
-
-#else /* !CONFIG_SUSPEND */
-
-#define of_platform_pm_suspend         NULL
-#define of_platform_pm_resume          NULL
-#define of_platform_pm_suspend_noirq   NULL
-#define of_platform_pm_resume_noirq    NULL
-
-#endif /* !CONFIG_SUSPEND */
-
-#ifdef CONFIG_HIBERNATION
-
-static int of_platform_pm_freeze(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->freeze)
-                       ret = drv->pm->freeze(dev);
-       } else {
-               ret = of_platform_legacy_suspend(dev, PMSG_FREEZE);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_freeze_noirq(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->freeze_noirq)
-                       ret = drv->pm->freeze_noirq(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_thaw(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->thaw)
-                       ret = drv->pm->thaw(dev);
-       } else {
-               ret = of_platform_legacy_resume(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_thaw_noirq(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->thaw_noirq)
-                       ret = drv->pm->thaw_noirq(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_poweroff(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->poweroff)
-                       ret = drv->pm->poweroff(dev);
-       } else {
-               ret = of_platform_legacy_suspend(dev, PMSG_HIBERNATE);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_poweroff_noirq(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->poweroff_noirq)
-                       ret = drv->pm->poweroff_noirq(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_restore(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->restore)
-                       ret = drv->pm->restore(dev);
-       } else {
-               ret = of_platform_legacy_resume(dev);
-       }
-
-       return ret;
-}
-
-static int of_platform_pm_restore_noirq(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-
-       if (!drv)
-               return 0;
-
-       if (drv->pm) {
-               if (drv->pm->restore_noirq)
-                       ret = drv->pm->restore_noirq(dev);
-       }
-
-       return ret;
-}
-
-#else /* !CONFIG_HIBERNATION */
-
-#define of_platform_pm_freeze          NULL
-#define of_platform_pm_thaw            NULL
-#define of_platform_pm_poweroff                NULL
-#define of_platform_pm_restore         NULL
-#define of_platform_pm_freeze_noirq    NULL
-#define of_platform_pm_thaw_noirq              NULL
-#define of_platform_pm_poweroff_noirq  NULL
-#define of_platform_pm_restore_noirq   NULL
-
-#endif /* !CONFIG_HIBERNATION */
-
-static struct dev_pm_ops of_platform_dev_pm_ops = {
-       .prepare = of_platform_pm_prepare,
-       .complete = of_platform_pm_complete,
-       .suspend = of_platform_pm_suspend,
-       .resume = of_platform_pm_resume,
-       .freeze = of_platform_pm_freeze,
-       .thaw = of_platform_pm_thaw,
-       .poweroff = of_platform_pm_poweroff,
-       .restore = of_platform_pm_restore,
-       .suspend_noirq = of_platform_pm_suspend_noirq,
-       .resume_noirq = of_platform_pm_resume_noirq,
-       .freeze_noirq = of_platform_pm_freeze_noirq,
-       .thaw_noirq = of_platform_pm_thaw_noirq,
-       .poweroff_noirq = of_platform_pm_poweroff_noirq,
-       .restore_noirq = of_platform_pm_restore_noirq,
-};
-
-#define OF_PLATFORM_PM_OPS_PTR (&of_platform_dev_pm_ops)
-
-#else /* !CONFIG_PM_SLEEP */
-
-#define OF_PLATFORM_PM_OPS_PTR NULL
-
-#endif /* !CONFIG_PM_SLEEP */
-
-int of_bus_type_init(struct bus_type *bus, const char *name)
-{
-       bus->name = name;
-       bus->match = of_platform_bus_match;
-       bus->probe = of_platform_device_probe;
-       bus->remove = of_platform_device_remove;
-       bus->shutdown = of_platform_device_shutdown;
-       bus->dev_attrs = of_platform_device_attrs;
-       bus->pm = OF_PLATFORM_PM_OPS_PTR;
-       return bus_register(bus);
-}
-
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-       /*
-        * Temporary: of_platform_bus used to be distinct from the platform
-        * bus.  It isn't anymore, and so drivers on the platform bus need
-        * to be registered in a special way.
-        *
-        * After all of_platform_bus_type drivers are converted to
-        * platform_drivers, this exception can be removed.
-        */
-       if (bus == &platform_bus_type)
-               return of_register_platform_driver(drv);
-
-       /* register with core */
-       drv->driver.bus = bus;
-       return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(of_register_driver);
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-       if (drv->driver.bus == &platform_bus_type)
-               of_unregister_platform_driver(drv);
-       else
-               driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(of_unregister_driver);
-
 #if !defined(CONFIG_SPARC)
 /*
  * The following routines scan a subtree and registers a device for
index 55ba118f1cf12aeef1de93981b2ecec7bfafcb74..910c5a26e3470191bd7f0111ea2eeb65e43c459e 100644 (file)
@@ -286,7 +286,7 @@ static struct parport_operations parport_sunbpp_ops =
        .owner          = THIS_MODULE,
 };
 
-static int __devinit bpp_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit bpp_probe(struct platform_device *op)
 {
        struct parport_operations *ops;
        struct bpp_regs __iomem *regs;
@@ -381,7 +381,7 @@ static const struct of_device_id bpp_match[] = {
 
 MODULE_DEVICE_TABLE(of, bpp_match);
 
-static struct of_platform_driver bpp_sbus_driver = {
+static struct platform_driver bpp_sbus_driver = {
        .driver = {
                .name = "bpp",
                .owner = THIS_MODULE,
@@ -393,12 +393,12 @@ static struct of_platform_driver bpp_sbus_driver = {
 
 static int __init parport_sunbpp_init(void)
 {
-       return of_register_platform_driver(&bpp_sbus_driver);
+       return platform_driver_register(&bpp_sbus_driver);
 }
 
 static void __exit parport_sunbpp_exit(void)
 {
-       of_unregister_platform_driver(&bpp_sbus_driver);
+       platform_driver_unregister(&bpp_sbus_driver);
 }
 
 MODULE_AUTHOR("Derrick J Brashear");
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 b40c1ff1ebc8e4b5e003a32312664e5be07ee6d1..09ccd8d3ba2ac6170b89f07fe14b791e66a8bbd9 100644 (file)
@@ -248,8 +248,7 @@ static const struct rtc_class_ops mpc5121_rtc_ops = {
        .alarm_irq_enable = mpc5121_rtc_alarm_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;
@@ -344,7 +343,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,
@@ -356,13 +355,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 614a5e114a19a1f37eed1d4ab2ea1e510300c6b7..5f94d22c491ecbf1c619e79b0e1ff8a75e23ccd4 100644 (file)
@@ -361,8 +361,7 @@ fail:
 extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
 extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
 
-static int __devinit bbc_i2c_probe(struct platform_device *op,
-                                  const struct of_device_id *match)
+static int __devinit bbc_i2c_probe(struct platform_device *op)
 {
        struct bbc_i2c_bus *bp;
        int err, index = 0;
@@ -413,7 +412,7 @@ static const struct of_device_id bbc_i2c_match[] = {
 };
 MODULE_DEVICE_TABLE(of, bbc_i2c_match);
 
-static struct of_platform_driver bbc_i2c_driver = {
+static struct platform_driver bbc_i2c_driver = {
        .driver = {
                .name = "bbc_i2c",
                .owner = THIS_MODULE,
@@ -425,12 +424,12 @@ static struct of_platform_driver bbc_i2c_driver = {
 
 static int __init bbc_i2c_init(void)
 {
-       return of_register_platform_driver(&bbc_i2c_driver);
+       return platform_driver_register(&bbc_i2c_driver);
 }
 
 static void __exit bbc_i2c_exit(void)
 {
-       of_unregister_platform_driver(&bbc_i2c_driver);
+       platform_driver_unregister(&bbc_i2c_driver);
 }
 
 module_init(bbc_i2c_init);
index 55f71ea9c4180c853148314c13e31df8cd608cea..740da4465447f68733b489ca775321dba7d357d0 100644 (file)
@@ -171,8 +171,7 @@ static struct miscdevice d7s_miscdev = {
        .fops           = &d7s_fops
 };
 
-static int __devinit d7s_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit d7s_probe(struct platform_device *op)
 {
        struct device_node *opts;
        int err = -EINVAL;
@@ -266,7 +265,7 @@ static const struct of_device_id d7s_match[] = {
 };
 MODULE_DEVICE_TABLE(of, d7s_match);
 
-static struct of_platform_driver d7s_driver = {
+static struct platform_driver d7s_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -278,12 +277,12 @@ static struct of_platform_driver d7s_driver = {
 
 static int __init d7s_init(void)
 {
-       return of_register_platform_driver(&d7s_driver);
+       return platform_driver_register(&d7s_driver);
 }
 
 static void __exit d7s_exit(void)
 {
-       of_unregister_platform_driver(&d7s_driver);
+       platform_driver_unregister(&d7s_driver);
 }
 
 module_init(d7s_init);
index 8ce414e39489495f9da40f84fa08630ac2beb215..be7b4e56154f9da35b81bee8fcbc2a238180f314 100644 (file)
@@ -1028,8 +1028,7 @@ static int kenvctrld(void *__unused)
        return 0;
 }
 
-static int __devinit envctrl_probe(struct platform_device *op,
-                                  const struct of_device_id *match)
+static int __devinit envctrl_probe(struct platform_device *op)
 {
        struct device_node *dp;
        int index, err;
@@ -1129,7 +1128,7 @@ static const struct of_device_id envctrl_match[] = {
 };
 MODULE_DEVICE_TABLE(of, envctrl_match);
 
-static struct of_platform_driver envctrl_driver = {
+static struct platform_driver envctrl_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
@@ -1141,12 +1140,12 @@ static struct of_platform_driver envctrl_driver = {
 
 static int __init envctrl_init(void)
 {
-       return of_register_platform_driver(&envctrl_driver);
+       return platform_driver_register(&envctrl_driver);
 }
 
 static void __exit envctrl_exit(void)
 {
-       of_unregister_platform_driver(&envctrl_driver);
+       platform_driver_unregister(&envctrl_driver);
 }
 
 module_init(envctrl_init);
index 2b4b4b613c48b1b3a0153653e808e865f782d479..73dd4e7afaaa0b84fb8a6fd9de3552cab37a8a19 100644 (file)
@@ -160,8 +160,7 @@ static const struct file_operations flash_fops = {
 
 static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
 
-static int __devinit flash_probe(struct platform_device *op,
-                                const struct of_device_id *match)
+static int __devinit flash_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct device_node *parent;
@@ -207,7 +206,7 @@ static const struct of_device_id flash_match[] = {
 };
 MODULE_DEVICE_TABLE(of, flash_match);
 
-static struct of_platform_driver flash_driver = {
+static struct platform_driver flash_driver = {
        .driver = {
                .name = "flash",
                .owner = THIS_MODULE,
@@ -219,12 +218,12 @@ static struct of_platform_driver flash_driver = {
 
 static int __init flash_init(void)
 {
-       return of_register_platform_driver(&flash_driver);
+       return platform_driver_register(&flash_driver);
 }
 
 static void __exit flash_cleanup(void)
 {
-       of_unregister_platform_driver(&flash_driver);
+       platform_driver_unregister(&flash_driver);
 }
 
 module_init(flash_init);
index 1b345be5cc02d184928a6efda53a2639741261c6..ebce9639a26abba176a3aff226a89abc3d13f8bc 100644 (file)
@@ -348,8 +348,7 @@ static void uctrl_get_external_status(struct uctrl_driver *driver)
        
 }
 
-static int __devinit uctrl_probe(struct platform_device *op,
-                                const struct of_device_id *match)
+static int __devinit uctrl_probe(struct platform_device *op)
 {
        struct uctrl_driver *p;
        int err = -ENOMEM;
@@ -425,7 +424,7 @@ static const struct of_device_id uctrl_match[] = {
 };
 MODULE_DEVICE_TABLE(of, uctrl_match);
 
-static struct of_platform_driver uctrl_driver = {
+static struct platform_driver uctrl_driver = {
        .driver = {
                .name = "uctrl",
                .owner = THIS_MODULE,
@@ -438,12 +437,12 @@ static struct of_platform_driver uctrl_driver = {
 
 static int __init uctrl_init(void)
 {
-       return of_register_platform_driver(&uctrl_driver);
+       return platform_driver_register(&uctrl_driver);
 }
 
 static void __exit uctrl_exit(void)
 {
-       of_unregister_platform_driver(&uctrl_driver);
+       platform_driver_unregister(&uctrl_driver);
 }
 
 module_init(uctrl_init);
index 664c9572d0c9a44b2540a05857c8710596d8b6c1..e2d45c91b8e8fa9d99d2d6abc17739aff12e6012 100644 (file)
@@ -1292,15 +1292,19 @@ static struct scsi_host_template qpti_template = {
        .use_clustering         = ENABLE_CLUSTERING,
 };
 
-static int __devinit qpti_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit qpti_sbus_probe(struct platform_device *op)
 {
-       struct scsi_host_template *tpnt = match->data;
+       struct scsi_host_template *tpnt;
        struct device_node *dp = op->dev.of_node;
        struct Scsi_Host *host;
        struct qlogicpti *qpti;
        static int nqptis;
        const char *fcode;
 
+       if (!op->dev.of_match)
+               return -EINVAL;
+       tpnt = op->dev.of_match->data;
+
        /* Sometimes Antares cards come up not completely
         * setup, and we get a report of a zero IRQ.
         */
@@ -1457,7 +1461,7 @@ static const struct of_device_id qpti_match[] = {
 };
 MODULE_DEVICE_TABLE(of, qpti_match);
 
-static struct of_platform_driver qpti_sbus_driver = {
+static struct platform_driver qpti_sbus_driver = {
        .driver = {
                .name = "qpti",
                .owner = THIS_MODULE,
@@ -1469,12 +1473,12 @@ static struct of_platform_driver qpti_sbus_driver = {
 
 static int __init qpti_init(void)
 {
-       return of_register_platform_driver(&qpti_sbus_driver);
+       return platform_driver_register(&qpti_sbus_driver);
 }
 
 static void __exit qpti_exit(void)
 {
-       of_unregister_platform_driver(&qpti_sbus_driver);
+       platform_driver_unregister(&qpti_sbus_driver);
 }
 
 MODULE_DESCRIPTION("QlogicISP SBUS driver");
index 193b37ba18344bb6e26a138bbd3e52ff9222fb64..676fe9ac7f61267bf156f7235aaa94e3c29af0a0 100644 (file)
@@ -562,7 +562,7 @@ fail:
        return err;
 }
 
-static int __devinit esp_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit esp_sbus_probe(struct platform_device *op)
 {
        struct device_node *dma_node = NULL;
        struct device_node *dp = op->dev.of_node;
@@ -632,7 +632,7 @@ static const struct of_device_id esp_match[] = {
 };
 MODULE_DEVICE_TABLE(of, esp_match);
 
-static struct of_platform_driver esp_sbus_driver = {
+static struct platform_driver esp_sbus_driver = {
        .driver = {
                .name = "esp",
                .owner = THIS_MODULE,
@@ -644,12 +644,12 @@ static struct of_platform_driver esp_sbus_driver = {
 
 static int __init sunesp_init(void)
 {
-       return of_register_platform_driver(&esp_sbus_driver);
+       return platform_driver_register(&esp_sbus_driver);
 }
 
 static void __exit sunesp_exit(void)
 {
-       of_unregister_platform_driver(&esp_sbus_driver);
+       platform_driver_unregister(&esp_sbus_driver);
 }
 
 MODULE_DESCRIPTION("Sun ESP SCSI driver");
index 77d9e7ee8b27b6502d39dcc1b08aaa827b8fd96b..6a5b4238fb6bd2dd43a0743371ed0550996f5333 100644 (file)
@@ -507,8 +507,7 @@ static int __devexit mpc512x_psc_spi_do_remove(struct device *dev)
        return 0;
 }
 
-static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op,
-                                             const struct of_device_id *match)
+static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op)
 {
        const u32 *regaddr_p;
        u64 regaddr64, size64;
@@ -551,7 +550,7 @@ static struct of_device_id mpc512x_psc_spi_of_match[] = {
 
 MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match);
 
-static struct of_platform_driver mpc512x_psc_spi_of_driver = {
+static struct platform_driver mpc512x_psc_spi_of_driver = {
        .probe = mpc512x_psc_spi_of_probe,
        .remove = __devexit_p(mpc512x_psc_spi_of_remove),
        .driver = {
@@ -563,13 +562,13 @@ static struct of_platform_driver mpc512x_psc_spi_of_driver = {
 
 static int __init mpc512x_psc_spi_init(void)
 {
-       return of_register_platform_driver(&mpc512x_psc_spi_of_driver);
+       return platform_driver_register(&mpc512x_psc_spi_of_driver);
 }
 module_init(mpc512x_psc_spi_init);
 
 static void __exit mpc512x_psc_spi_exit(void)
 {
-       of_unregister_platform_driver(&mpc512x_psc_spi_of_driver);
+       platform_driver_unregister(&mpc512x_psc_spi_of_driver);
 }
 module_exit(mpc512x_psc_spi_exit);
 
index 8a904c1c8485e67f215971932782c2f02a29eff5..e30baf0852ac78bf338fd31b7869896169649d37 100644 (file)
@@ -450,8 +450,7 @@ free_master:
        return ret;
 }
 
-static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op,
-       const struct of_device_id *match)
+static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op)
 {
        const u32 *regaddr_p;
        u64 regaddr64, size64;
@@ -503,7 +502,7 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = {
 
 MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
 
-static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
+static struct platform_driver mpc52xx_psc_spi_of_driver = {
        .probe = mpc52xx_psc_spi_of_probe,
        .remove = __devexit_p(mpc52xx_psc_spi_of_remove),
        .driver = {
@@ -515,13 +514,13 @@ static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
 
 static int __init mpc52xx_psc_spi_init(void)
 {
-       return of_register_platform_driver(&mpc52xx_psc_spi_of_driver);
+       return platform_driver_register(&mpc52xx_psc_spi_of_driver);
 }
 module_init(mpc52xx_psc_spi_init);
 
 static void __exit mpc52xx_psc_spi_exit(void)
 {
-       of_unregister_platform_driver(&mpc52xx_psc_spi_of_driver);
+       platform_driver_unregister(&mpc52xx_psc_spi_of_driver);
 }
 module_exit(mpc52xx_psc_spi_exit);
 
index 84439f655601f71577483acd423aed7622fae807..015a974bed72d83b40d15407597c84749490ba66 100644 (file)
@@ -390,8 +390,7 @@ static int mpc52xx_spi_transfer(struct spi_device *spi, struct spi_message *m)
 /*
  * OF Platform Bus Binding
  */
-static int __devinit mpc52xx_spi_probe(struct platform_device *op,
-                                      const struct of_device_id *match)
+static int __devinit mpc52xx_spi_probe(struct platform_device *op)
 {
        struct spi_master *master;
        struct mpc52xx_spi *ms;
@@ -556,7 +555,7 @@ static const struct of_device_id mpc52xx_spi_match[] __devinitconst = {
 };
 MODULE_DEVICE_TABLE(of, mpc52xx_spi_match);
 
-static struct of_platform_driver mpc52xx_spi_of_driver = {
+static struct platform_driver mpc52xx_spi_of_driver = {
        .driver = {
                .name = "mpc52xx-spi",
                .owner = THIS_MODULE,
@@ -568,13 +567,13 @@ static struct of_platform_driver mpc52xx_spi_of_driver = {
 
 static int __init mpc52xx_spi_init(void)
 {
-       return of_register_platform_driver(&mpc52xx_spi_of_driver);
+       return platform_driver_register(&mpc52xx_spi_of_driver);
 }
 module_init(mpc52xx_spi_init);
 
 static void __exit mpc52xx_spi_exit(void)
 {
-       of_unregister_platform_driver(&mpc52xx_spi_of_driver);
+       platform_driver_unregister(&mpc52xx_spi_of_driver);
 }
 module_exit(mpc52xx_spi_exit);
 
index a99e2333b949efdbc10e391253ae952137238b7d..900e921ab80e511540b29950bb56d84c46f42476 100644 (file)
@@ -685,8 +685,7 @@ static int of_fsl_espi_get_chipselects(struct device *dev)
        return 0;
 }
 
-static int __devinit of_fsl_espi_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *ofid)
+static int __devinit of_fsl_espi_probe(struct platform_device *ofdev)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
@@ -695,7 +694,7 @@ static int __devinit of_fsl_espi_probe(struct platform_device *ofdev,
        struct resource irq;
        int ret = -ENOMEM;
 
-       ret = of_mpc8xxx_spi_probe(ofdev, ofid);
+       ret = of_mpc8xxx_spi_probe(ofdev);
        if (ret)
                return ret;
 
@@ -736,7 +735,7 @@ static const struct of_device_id of_fsl_espi_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_fsl_espi_match);
 
-static struct of_platform_driver fsl_espi_driver = {
+static struct platform_driver fsl_espi_driver = {
        .driver = {
                .name = "fsl_espi",
                .owner = THIS_MODULE,
@@ -748,13 +747,13 @@ static struct of_platform_driver fsl_espi_driver = {
 
 static int __init fsl_espi_init(void)
 {
-       return of_register_platform_driver(&fsl_espi_driver);
+       return platform_driver_register(&fsl_espi_driver);
 }
 module_init(fsl_espi_init);
 
 static void __exit fsl_espi_exit(void)
 {
-       of_unregister_platform_driver(&fsl_espi_driver);
+       platform_driver_unregister(&fsl_espi_driver);
 }
 module_exit(fsl_espi_exit);
 
index 5cd741fdb5c328bae5cc3ed3222abc8abeba5010..ff59f42ae990ee8ef2330ddd19aa1242389cec04 100644 (file)
@@ -189,8 +189,7 @@ int __devexit mpc8xxx_spi_remove(struct device *dev)
        return 0;
 }
 
-int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *ofid)
+int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
index 281e060977cdfedb1561edba3d1b82eb99a568dd..cbe881b9ea76c6cace348ba010047ac6479e9ae2 100644 (file)
@@ -118,7 +118,6 @@ extern const char *mpc8xxx_spi_strmode(unsigned int flags);
 extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
                unsigned int irq);
 extern int mpc8xxx_spi_remove(struct device *dev);
-extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev,
-                               const struct of_device_id *ofid);
+extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev);
 
 #endif /* __SPI_FSL_LIB_H__ */
index 7ca52d3ae8f8bc3d322ec273042960fbdc6a9e9c..7963c9b495662d792d9681d17fdad4ddb1c0a082 100644 (file)
@@ -1042,8 +1042,7 @@ static int of_fsl_spi_free_chipselects(struct device *dev)
        return 0;
 }
 
-static int __devinit of_fsl_spi_probe(struct platform_device *ofdev,
-                                       const struct of_device_id *ofid)
+static int __devinit of_fsl_spi_probe(struct platform_device *ofdev)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *np = ofdev->dev.of_node;
@@ -1052,7 +1051,7 @@ static int __devinit of_fsl_spi_probe(struct platform_device *ofdev,
        struct resource irq;
        int ret = -ENOMEM;
 
-       ret = of_mpc8xxx_spi_probe(ofdev, ofid);
+       ret = of_mpc8xxx_spi_probe(ofdev);
        if (ret)
                return ret;
 
@@ -1100,7 +1099,7 @@ static const struct of_device_id of_fsl_spi_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_fsl_spi_match);
 
-static struct of_platform_driver of_fsl_spi_driver = {
+static struct platform_driver of_fsl_spi_driver = {
        .driver = {
                .name = "fsl_spi",
                .owner = THIS_MODULE,
@@ -1177,13 +1176,13 @@ static void __exit legacy_driver_unregister(void) {}
 static int __init fsl_spi_init(void)
 {
        legacy_driver_register();
-       return of_register_platform_driver(&of_fsl_spi_driver);
+       return platform_driver_register(&of_fsl_spi_driver);
 }
 module_init(fsl_spi_init);
 
 static void __exit fsl_spi_exit(void)
 {
-       of_unregister_platform_driver(&of_fsl_spi_driver);
+       platform_driver_unregister(&of_fsl_spi_driver);
        legacy_driver_unregister();
 }
 module_exit(fsl_spi_exit);
index 80e172d3e72a7faab0064db66640c815c836e7a2..2a298c0291941af8abcf91ee1f9ee5fec934199e 100644 (file)
@@ -390,8 +390,7 @@ static void free_gpios(struct ppc4xx_spi *hw)
 /*
  * platform_device layer stuff...
  */
-static int __init spi_ppc4xx_of_probe(struct platform_device *op,
-                                     const struct of_device_id *match)
+static int __init spi_ppc4xx_of_probe(struct platform_device *op)
 {
        struct ppc4xx_spi *hw;
        struct spi_master *master;
@@ -586,7 +585,7 @@ static const struct of_device_id spi_ppc4xx_of_match[] = {
 
 MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match);
 
-static struct of_platform_driver spi_ppc4xx_of_driver = {
+static struct platform_driver spi_ppc4xx_of_driver = {
        .probe = spi_ppc4xx_of_probe,
        .remove = __exit_p(spi_ppc4xx_of_remove),
        .driver = {
@@ -598,13 +597,13 @@ static struct of_platform_driver spi_ppc4xx_of_driver = {
 
 static int __init spi_ppc4xx_init(void)
 {
-       return of_register_platform_driver(&spi_ppc4xx_of_driver);
+       return platform_driver_register(&spi_ppc4xx_of_driver);
 }
 module_init(spi_ppc4xx_init);
 
 static void __exit spi_ppc4xx_exit(void)
 {
-       of_unregister_platform_driver(&spi_ppc4xx_of_driver);
+       platform_driver_unregister(&spi_ppc4xx_of_driver);
 }
 module_exit(spi_ppc4xx_exit);
 
index 8f014bb916b7c76a01f7a07b09218cf8b4da8df5..60e049b041a7a9425ec95db6689ab575e0fbbad2 100644 (file)
@@ -466,12 +466,23 @@ static int __devexit altera_jtaguart_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_jtaguart_match[] = {
+       { .compatible = "ALTR,juart-1.0", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#else
+#define altera_jtaguart_match NULL
+#endif /* CONFIG_OF */
+
 static struct platform_driver altera_jtaguart_platform_driver = {
        .probe  = altera_jtaguart_probe,
        .remove = __devexit_p(altera_jtaguart_remove),
        .driver = {
-               .name   = DRV_NAME,
-               .owner  = THIS_MODULE,
+               .name           = DRV_NAME,
+               .owner          = THIS_MODULE,
+               .of_match_table = altera_jtaguart_match,
        },
 };
 
index 3a573528555e5b98d694a50417228b82ddaaa4ef..6d5b036ac7834883e8273dd32a378f27d340aeff 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/serial.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/io.h>
 #include <linux/altera_uart.h>
 
@@ -507,6 +508,29 @@ static struct uart_driver altera_uart_driver = {
        .cons           = ALTERA_UART_CONSOLE,
 };
 
+#ifdef CONFIG_OF
+static int altera_uart_get_of_uartclk(struct platform_device *pdev,
+                                     struct uart_port *port)
+{
+       int len;
+       const __be32 *clk;
+
+       clk = of_get_property(pdev->dev.of_node, "clock-frequency", &len);
+       if (!clk || len < sizeof(__be32))
+               return -ENODEV;
+
+       port->uartclk = be32_to_cpup(clk);
+
+       return 0;
+}
+#else
+static int altera_uart_get_of_uartclk(struct platform_device *pdev,
+                                     struct uart_port *port)
+{
+       return -ENODEV;
+}
+#endif /* CONFIG_OF */
+
 static int __devinit altera_uart_probe(struct platform_device *pdev)
 {
        struct altera_uart_platform_uart *platp = pdev->dev.platform_data;
@@ -514,6 +538,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
        struct resource *res_mem;
        struct resource *res_irq;
        int i = pdev->id;
+       int ret;
 
        /* -1 emphasizes that the platform must have one port, no .N suffix */
        if (i == -1)
@@ -538,6 +563,15 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
        else if (platp->irq)
                port->irq = platp->irq;
 
+       /* Check platform data first so we can override device node data */
+       if (platp)
+               port->uartclk = platp->uartclk;
+       else {
+               ret = altera_uart_get_of_uartclk(pdev, port);
+               if (ret)
+                       return ret;
+       }
+
        port->membase = ioremap(port->mapbase, ALTERA_UART_SIZE);
        if (!port->membase)
                return -ENOMEM;
@@ -550,7 +584,6 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
        port->line = i;
        port->type = PORT_ALTERA_UART;
        port->iotype = SERIAL_IO_MEM;
-       port->uartclk = platp->uartclk;
        port->ops = &altera_uart_ops;
        port->flags = UPF_BOOT_AUTOCONF;
 
@@ -573,13 +606,23 @@ static int __devexit altera_uart_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_uart_match[] = {
+       { .compatible = "ALTR,uart-1.0", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, altera_uart_match);
+#else
+#define altera_uart_match NULL
+#endif /* CONFIG_OF */
+
 static struct platform_driver altera_uart_platform_driver = {
        .probe  = altera_uart_probe,
        .remove = __devexit_p(altera_uart_remove),
        .driver = {
-               .name   = DRV_NAME,
-               .owner  = THIS_MODULE,
-               .pm     = NULL,
+               .name           = DRV_NAME,
+               .owner          = THIS_MODULE,
+               .of_match_table = altera_uart_match,
        },
 };
 
index 095a5d562618ceb0f829465542699506617b729c..1ab999b04ef39258b2f4ba79d17e784678d8734a 100644 (file)
@@ -553,8 +553,7 @@ static struct uart_driver grlib_apbuart_driver = {
 /* OF Platform Driver                                                       */
 /* ======================================================================== */
 
-static int __devinit apbuart_probe(struct platform_device *op,
-                                  const struct of_device_id *match)
+static int __devinit apbuart_probe(struct platform_device *op)
 {
        int i = -1;
        struct uart_port *port = NULL;
@@ -587,7 +586,7 @@ static struct of_device_id __initdata apbuart_match[] = {
        {},
 };
 
-static struct of_platform_driver grlib_apbuart_of_driver = {
+static struct platform_driver grlib_apbuart_of_driver = {
        .probe = apbuart_probe,
        .driver = {
                .owner = THIS_MODULE,
@@ -676,10 +675,10 @@ static int __init grlib_apbuart_init(void)
                return ret;
        }
 
-       ret = of_register_platform_driver(&grlib_apbuart_of_driver);
+       ret = platform_driver_register(&grlib_apbuart_of_driver);
        if (ret) {
                printk(KERN_ERR
-                      "%s: of_register_platform_driver failed (%i)\n",
+                      "%s: platform_driver_register failed (%i)\n",
                       __FILE__, ret);
                uart_unregister_driver(&grlib_apbuart_driver);
                return ret;
@@ -697,7 +696,7 @@ static void __exit grlib_apbuart_exit(void)
                                     &grlib_apbuart_ports[i]);
 
        uart_unregister_driver(&grlib_apbuart_driver);
-       of_unregister_platform_driver(&grlib_apbuart_of_driver);
+       platform_driver_unregister(&grlib_apbuart_of_driver);
 }
 
 module_init(grlib_apbuart_init);
index 8692ff98fc07d0ded59df2979249f4dfcaa04d33..a9a6a5fd169ecfac48d6311be190ff6655a7b718 100644 (file)
@@ -1359,8 +1359,7 @@ static struct uart_driver cpm_reg = {
 
 static int probe_index;
 
-static int __devinit cpm_uart_probe(struct platform_device *ofdev,
-                                    const struct of_device_id *match)
+static int __devinit cpm_uart_probe(struct platform_device *ofdev)
 {
        int index = probe_index++;
        struct uart_cpm_port *pinfo = &cpm_uart_ports[index];
@@ -1405,7 +1404,7 @@ static struct of_device_id cpm_uart_match[] = {
        {}
 };
 
-static struct of_platform_driver cpm_uart_driver = {
+static struct platform_driver cpm_uart_driver = {
        .driver = {
                .name = "cpm_uart",
                .owner = THIS_MODULE,
@@ -1421,7 +1420,7 @@ static int __init cpm_uart_init(void)
        if (ret)
                return ret;
 
-       ret = of_register_platform_driver(&cpm_uart_driver);
+       ret = platform_driver_register(&cpm_uart_driver);
        if (ret)
                uart_unregister_driver(&cpm_reg);
 
@@ -1430,7 +1429,7 @@ static int __init cpm_uart_init(void)
 
 static void __exit cpm_uart_exit(void)
 {
-       of_unregister_platform_driver(&cpm_uart_driver);
+       platform_driver_unregister(&cpm_uart_driver);
        uart_unregister_driver(&cpm_reg);
 }
 
index 126ec7f568ec65bb54c83d4661ec8541db7b86a5..a0bcd8a3758dd63f2103768d7fd7dc8ab65ca8ad 100644 (file)
@@ -1302,8 +1302,7 @@ static struct of_device_id mpc52xx_uart_of_match[] = {
        {},
 };
 
-static int __devinit
-mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
 {
        int idx = -1;
        unsigned int uartclk;
@@ -1311,8 +1310,6 @@ mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *mat
        struct resource res;
        int ret;
 
-       dev_dbg(&op->dev, "mpc52xx_uart_probe(op=%p, match=%p)\n", op, match);
-
        /* Check validity & presence */
        for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++)
                if (mpc52xx_uart_nodes[idx] == op->dev.of_node)
@@ -1453,7 +1450,7 @@ mpc52xx_uart_of_enumerate(void)
 
 MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
 
-static struct of_platform_driver mpc52xx_uart_of_driver = {
+static struct platform_driver mpc52xx_uart_of_driver = {
        .probe          = mpc52xx_uart_of_probe,
        .remove         = mpc52xx_uart_of_remove,
 #ifdef CONFIG_PM
@@ -1497,9 +1494,9 @@ mpc52xx_uart_init(void)
                        return ret;
        }
 
-       ret = of_register_platform_driver(&mpc52xx_uart_of_driver);
+       ret = platform_driver_register(&mpc52xx_uart_of_driver);
        if (ret) {
-               printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n",
+               printk(KERN_ERR "%s: platform_driver_register failed (%i)\n",
                       __FILE__, ret);
                uart_unregister_driver(&mpc52xx_uart_driver);
                return ret;
@@ -1514,7 +1511,7 @@ mpc52xx_uart_exit(void)
        if (psc_ops->fifoc_uninit)
                psc_ops->fifoc_uninit();
 
-       of_unregister_platform_driver(&mpc52xx_uart_of_driver);
+       platform_driver_unregister(&mpc52xx_uart_of_driver);
        uart_unregister_driver(&mpc52xx_uart_driver);
 }
 
index 6a18ca6ddaa9370028a81dd13b5206fb0326ebed..0e8eec516df4d94f0395842a3f4573cd036dbfdc 100644 (file)
@@ -80,14 +80,16 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
 /*
  * Try to register a serial port
  */
-static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
-                                               const struct of_device_id *id)
+static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
 {
        struct of_serial_info *info;
        struct uart_port port;
        int port_type;
        int ret;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+
        if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
                return -EBUSY;
 
@@ -95,7 +97,7 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
        if (info == NULL)
                return -ENOMEM;
 
-       port_type = (unsigned long)id->data;
+       port_type = (unsigned long)ofdev->dev.of_match->data;
        ret = of_platform_serial_setup(ofdev, port_type, &port);
        if (ret)
                goto out;
@@ -174,7 +176,7 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
        { /* end of list */ },
 };
 
-static struct of_platform_driver of_platform_serial_driver = {
+static struct platform_driver of_platform_serial_driver = {
        .driver = {
                .name = "of_serial",
                .owner = THIS_MODULE,
@@ -186,13 +188,13 @@ static struct of_platform_driver of_platform_serial_driver = {
 
 static int __init of_platform_serial_init(void)
 {
-       return of_register_platform_driver(&of_platform_serial_driver);
+       return platform_driver_register(&of_platform_serial_driver);
 }
 module_init(of_platform_serial_init);
 
 static void __exit of_platform_serial_exit(void)
 {
-       return of_unregister_platform_driver(&of_platform_serial_driver);
+       return platform_driver_unregister(&of_platform_serial_driver);
 };
 module_exit(of_platform_serial_exit);
 
index c9014868297d9f20a1a11a36d3361b86a148635c..c0b7246d733902c221bf540c9b77f3bdfcf211ec 100644 (file)
@@ -519,7 +519,7 @@ static struct console sunhv_console = {
        .data   =       &sunhv_reg,
 };
 
-static int __devinit hv_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit hv_probe(struct platform_device *op)
 {
        struct uart_port *port;
        unsigned long minor;
@@ -629,7 +629,7 @@ static const struct of_device_id hv_match[] = {
 };
 MODULE_DEVICE_TABLE(of, hv_match);
 
-static struct of_platform_driver hv_driver = {
+static struct platform_driver hv_driver = {
        .driver = {
                .name = "hv",
                .owner = THIS_MODULE,
@@ -644,12 +644,12 @@ static int __init sunhv_init(void)
        if (tlb_type != hypervisor)
                return -ENODEV;
 
-       return of_register_platform_driver(&hv_driver);
+       return platform_driver_register(&hv_driver);
 }
 
 static void __exit sunhv_exit(void)
 {
-       of_unregister_platform_driver(&hv_driver);
+       platform_driver_unregister(&hv_driver);
 }
 
 module_init(sunhv_init);
index 5b246b18f42fc06ce1d422c8465f9f7c906577e9..b5fa2a57b9da7ba1060194f356efb9756d5d3403 100644 (file)
@@ -1006,7 +1006,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up,
        return 0;
 }
 
-static int __devinit sab_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit sab_probe(struct platform_device *op)
 {
        static int inst;
        struct uart_sunsab_port *up;
@@ -1092,7 +1092,7 @@ static const struct of_device_id sab_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sab_match);
 
-static struct of_platform_driver sab_driver = {
+static struct platform_driver sab_driver = {
        .driver = {
                .name = "sab",
                .owner = THIS_MODULE,
@@ -1130,12 +1130,12 @@ static int __init sunsab_init(void)
                }
        }
 
-       return of_register_platform_driver(&sab_driver);
+       return platform_driver_register(&sab_driver);
 }
 
 static void __exit sunsab_exit(void)
 {
-       of_unregister_platform_driver(&sab_driver);
+       platform_driver_unregister(&sab_driver);
        if (sunsab_reg.nr) {
                sunserial_unregister_minors(&sunsab_reg, sunsab_reg.nr);
        }
index 551ebfe3ccbbf729e94964527e1dd3095cfe2170..92aa54550e84babbae1d4451e87efe6e65690d4a 100644 (file)
@@ -1406,7 +1406,7 @@ static enum su_type __devinit su_get_type(struct device_node *dp)
        return SU_PORT_PORT;
 }
 
-static int __devinit su_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit su_probe(struct platform_device *op)
 {
        static int inst;
        struct device_node *dp = op->dev.of_node;
@@ -1543,7 +1543,7 @@ static const struct of_device_id su_match[] = {
 };
 MODULE_DEVICE_TABLE(of, su_match);
 
-static struct of_platform_driver su_driver = {
+static struct platform_driver su_driver = {
        .driver = {
                .name = "su",
                .owner = THIS_MODULE,
@@ -1586,7 +1586,7 @@ static int __init sunsu_init(void)
                        return err;
        }
 
-       err = of_register_platform_driver(&su_driver);
+       err = platform_driver_register(&su_driver);
        if (err && num_uart)
                sunserial_unregister_minors(&sunsu_reg, num_uart);
 
index c1967ac1c07fd51c592d15554c024f497072806b..99ff9abf57cede4e7b234a7d72ce983ff67aa892 100644 (file)
@@ -1399,7 +1399,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
 
 static int zilog_irq = -1;
 
-static int __devinit zs_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit zs_probe(struct platform_device *op)
 {
        static int kbm_inst, uart_inst;
        int inst;
@@ -1540,7 +1540,7 @@ static const struct of_device_id zs_match[] = {
 };
 MODULE_DEVICE_TABLE(of, zs_match);
 
-static struct of_platform_driver zs_driver = {
+static struct platform_driver zs_driver = {
        .driver = {
                .name = "zs",
                .owner = THIS_MODULE,
@@ -1576,7 +1576,7 @@ static int __init sunzilog_init(void)
                        goto out_free_tables;
        }
 
-       err = of_register_platform_driver(&zs_driver);
+       err = platform_driver_register(&zs_driver);
        if (err)
                goto out_unregister_uart;
 
@@ -1604,7 +1604,7 @@ out:
        return err;
 
 out_unregister_driver:
-       of_unregister_platform_driver(&zs_driver);
+       platform_driver_unregister(&zs_driver);
 
 out_unregister_uart:
        if (num_sunzilog) {
@@ -1619,7 +1619,7 @@ out_free_tables:
 
 static void __exit sunzilog_exit(void)
 {
-       of_unregister_platform_driver(&zs_driver);
+       platform_driver_unregister(&zs_driver);
 
        if (zilog_irq != -1) {
                struct uart_sunzilog_port *up = sunzilog_irq_chain;
index d2fce865b73180a70e9e3d3bf7435dc07b79fcc7..8af1ed83a4c090590cf09d6f737e5520934f18b1 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <asm/io.h>
-#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 
-/* Match table for of_platform binding */
-static struct of_device_id ulite_of_match[] __devinitdata = {
-       { .compatible = "xlnx,opb-uartlite-1.00.b", },
-       { .compatible = "xlnx,xps-uartlite-1.00.a", },
-       {}
-};
-MODULE_DEVICE_TABLE(of, ulite_of_match);
-
-#endif
-
 #define ULITE_NAME             "ttyUL"
 #define ULITE_MAJOR            204
 #define ULITE_MINOR            187
@@ -571,9 +560,29 @@ static int __devexit ulite_release(struct device *dev)
  * Platform bus binding
  */
 
+#if defined(CONFIG_OF)
+/* Match table for of_platform binding */
+static struct of_device_id ulite_of_match[] __devinitdata = {
+       { .compatible = "xlnx,opb-uartlite-1.00.b", },
+       { .compatible = "xlnx,xps-uartlite-1.00.a", },
+       {}
+};
+MODULE_DEVICE_TABLE(of, ulite_of_match);
+#else /* CONFIG_OF */
+#define ulite_of_match NULL
+#endif /* CONFIG_OF */
+
 static int __devinit ulite_probe(struct platform_device *pdev)
 {
        struct resource *res, *res2;
+       int id = pdev->id;
+#ifdef CONFIG_OF
+       const __be32 *prop;
+
+       prop = of_get_property(pdev->dev.of_node, "port-number", NULL);
+       if (prop)
+               id = be32_to_cpup(prop);
+#endif
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
@@ -583,7 +592,7 @@ static int __devinit ulite_probe(struct platform_device *pdev)
        if (!res2)
                return -ENODEV;
 
-       return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
+       return ulite_assign(&pdev->dev, id, res->start, res2->start);
 }
 
 static int __devexit ulite_remove(struct platform_device *pdev)
@@ -595,72 +604,15 @@ static int __devexit ulite_remove(struct platform_device *pdev)
 MODULE_ALIAS("platform:uartlite");
 
 static struct platform_driver ulite_platform_driver = {
-       .probe  = ulite_probe,
-       .remove = __devexit_p(ulite_remove),
-       .driver = {
-                  .owner = THIS_MODULE,
-                  .name  = "uartlite",
-                  },
-};
-
-/* ---------------------------------------------------------------------
- * OF bus bindings
- */
-#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
-static int __devinit
-ulite_of_probe(struct platform_device *op, const struct of_device_id *match)
-{
-       struct resource res;
-       const unsigned int *id;
-       int irq, rc;
-
-       dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match);
-
-       rc = of_address_to_resource(op->dev.of_node, 0, &res);
-       if (rc) {
-               dev_err(&op->dev, "invalid address\n");
-               return rc;
-       }
-
-       irq = irq_of_parse_and_map(op->dev.of_node, 0);
-
-       id = of_get_property(op->dev.of_node, "port-number", NULL);
-
-       return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
-}
-
-static int __devexit ulite_of_remove(struct platform_device *op)
-{
-       return ulite_release(&op->dev);
-}
-
-static struct of_platform_driver ulite_of_driver = {
-       .probe = ulite_of_probe,
-       .remove = __devexit_p(ulite_of_remove),
+       .probe = ulite_probe,
+       .remove = __devexit_p(ulite_remove),
        .driver = {
-               .name = "uartlite",
                .owner = THIS_MODULE,
+               .name  = "uartlite",
                .of_match_table = ulite_of_match,
        },
 };
 
-/* Registration helpers to keep the number of #ifdefs to a minimum */
-static inline int __init ulite_of_register(void)
-{
-       pr_debug("uartlite: calling of_register_platform_driver()\n");
-       return of_register_platform_driver(&ulite_of_driver);
-}
-
-static inline void __exit ulite_of_unregister(void)
-{
-       of_unregister_platform_driver(&ulite_of_driver);
-}
-#else /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
-/* Appropriate config not enabled; do nothing helpers */
-static inline int __init ulite_of_register(void) { return 0; }
-static inline void __exit ulite_of_unregister(void) { }
-#endif /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
-
 /* ---------------------------------------------------------------------
  * Module setup/teardown
  */
@@ -674,10 +626,6 @@ int __init ulite_init(void)
        if (ret)
                goto err_uart;
 
-       ret = ulite_of_register();
-       if (ret)
-               goto err_of;
-
        pr_debug("uartlite: calling platform_driver_register()\n");
        ret = platform_driver_register(&ulite_platform_driver);
        if (ret)
@@ -686,8 +634,6 @@ int __init ulite_init(void)
        return 0;
 
 err_plat:
-       ulite_of_unregister();
-err_of:
        uart_unregister_driver(&ulite_uart_driver);
 err_uart:
        printk(KERN_ERR "registering uartlite driver failed: err=%i", ret);
@@ -697,7 +643,6 @@ err_uart:
 void __exit ulite_exit(void)
 {
        platform_driver_unregister(&ulite_platform_driver);
-       ulite_of_unregister();
        uart_unregister_driver(&ulite_uart_driver);
 }
 
index 3f4848e2174a2c50c6f2216a8862066ec10b3fcd..ff51dae1df0c2bb8b27cce63379569dfd560e791 100644 (file)
@@ -1194,8 +1194,7 @@ static void uart_firmware_cont(const struct firmware *fw, void *context)
        release_firmware(fw);
 }
 
-static int ucc_uart_probe(struct platform_device *ofdev,
-       const struct of_device_id *match)
+static int ucc_uart_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        const unsigned int *iprop;      /* Integer OF properties */
@@ -1485,7 +1484,7 @@ static struct of_device_id ucc_uart_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ucc_uart_match);
 
-static struct of_platform_driver ucc_uart_of_driver = {
+static struct platform_driver ucc_uart_of_driver = {
        .driver = {
                .name = "ucc_uart",
                .owner = THIS_MODULE,
@@ -1510,7 +1509,7 @@ static int __init ucc_uart_init(void)
                return ret;
        }
 
-       ret = of_register_platform_driver(&ucc_uart_of_driver);
+       ret = platform_driver_register(&ucc_uart_of_driver);
        if (ret)
                printk(KERN_ERR
                       "ucc-uart: could not register platform driver\n");
@@ -1523,7 +1522,7 @@ static void __exit ucc_uart_exit(void)
        printk(KERN_INFO
               "Freescale QUICC Engine UART device driver unloading\n");
 
-       of_unregister_platform_driver(&ucc_uart_of_driver);
+       platform_driver_unregister(&ucc_uart_of_driver);
        uart_unregister_driver(&ucc_uart_driver);
 }
 
index 792d5ef4013737ab4ec48971b5985a3af3aad549..aee7e3c53c380bf625763ed2af17296591b02a7a 100644 (file)
@@ -2523,8 +2523,7 @@ static void qe_udc_release(struct device *dev)
 }
 
 /* Driver probe functions */
-static int __devinit qe_udc_probe(struct platform_device *ofdev,
-                       const struct of_device_id *match)
+static int __devinit qe_udc_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct qe_ep *ep;
@@ -2532,6 +2531,9 @@ static int __devinit qe_udc_probe(struct platform_device *ofdev,
        unsigned int i;
        const void *prop;
 
+       if (!ofdev->dev.of_match)
+               return -EINVAL;
+
        prop = of_get_property(np, "mode", NULL);
        if (!prop || strcmp(prop, "peripheral"))
                return -ENODEV;
@@ -2543,7 +2545,7 @@ static int __devinit qe_udc_probe(struct platform_device *ofdev,
                return -ENOMEM;
        }
 
-       udc_controller->soc_type = (unsigned long)match->data;
+       udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data;
        udc_controller->usb_regs = of_iomap(np, 0);
        if (!udc_controller->usb_regs) {
                ret = -ENOMEM;
@@ -2768,7 +2770,7 @@ static const struct of_device_id qe_udc_match[] __devinitconst = {
 
 MODULE_DEVICE_TABLE(of, qe_udc_match);
 
-static struct of_platform_driver udc_driver = {
+static struct platform_driver udc_driver = {
        .driver = {
                .name = (char *)driver_name,
                .owner = THIS_MODULE,
@@ -2786,12 +2788,12 @@ static int __init qe_udc_init(void)
 {
        printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc,
                        DRIVER_VERSION);
-       return of_register_platform_driver(&udc_driver);
+       return platform_driver_register(&udc_driver);
 }
 
 static void __exit qe_udc_exit(void)
 {
-       of_unregister_platform_driver(&udc_driver);
+       platform_driver_unregister(&udc_driver);
 }
 
 module_init(qe_udc_init);
index d30c4e08c137fd7bc86bfbc721a008b86013dbc4..78561d112c0479dcb19edae56fc59a263e9f307e 100644 (file)
@@ -1317,24 +1317,24 @@ static int __init ehci_hcd_init(void)
 #endif
 
 #ifdef OF_PLATFORM_DRIVER
-       retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
+       retval = platform_driver_register(&OF_PLATFORM_DRIVER);
        if (retval < 0)
                goto clean3;
 #endif
 
 #ifdef XILINX_OF_PLATFORM_DRIVER
-       retval = of_register_platform_driver(&XILINX_OF_PLATFORM_DRIVER);
+       retval = platform_driver_register(&XILINX_OF_PLATFORM_DRIVER);
        if (retval < 0)
                goto clean4;
 #endif
        return retval;
 
 #ifdef XILINX_OF_PLATFORM_DRIVER
-       /* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */
+       /* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */
 clean4:
 #endif
 #ifdef OF_PLATFORM_DRIVER
-       of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+       platform_driver_unregister(&OF_PLATFORM_DRIVER);
 clean3:
 #endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
@@ -1362,10 +1362,10 @@ module_init(ehci_hcd_init);
 static void __exit ehci_hcd_cleanup(void)
 {
 #ifdef XILINX_OF_PLATFORM_DRIVER
-       of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER);
+       platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER);
 #endif
 #ifdef OF_PLATFORM_DRIVER
-       of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+       platform_driver_unregister(&OF_PLATFORM_DRIVER);
 #endif
 #ifdef PLATFORM_DRIVER
        platform_driver_unregister(&PLATFORM_DRIVER);
index ba52be473027a82dd20bcb20aa724f4c4b472f78..1f09f253697e9c810bd155cab92d66a7cd6332a2 100644 (file)
@@ -105,8 +105,7 @@ ppc44x_enable_bmt(struct device_node *dn)
 }
 
 
-static int __devinit
-ehci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op)
 {
        struct device_node *dn = op->dev.of_node;
        struct usb_hcd *hcd;
@@ -255,14 +254,12 @@ static int ehci_hcd_ppc_of_remove(struct platform_device *op)
 }
 
 
-static int ehci_hcd_ppc_of_shutdown(struct platform_device *op)
+static void ehci_hcd_ppc_of_shutdown(struct platform_device *op)
 {
        struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
 
        if (hcd->driver->shutdown)
                hcd->driver->shutdown(hcd);
-
-       return 0;
 }
 
 
@@ -275,7 +272,7 @@ static const struct of_device_id ehci_hcd_ppc_of_match[] = {
 MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match);
 
 
-static struct of_platform_driver ehci_hcd_ppc_of_driver = {
+static struct platform_driver ehci_hcd_ppc_of_driver = {
        .probe          = ehci_hcd_ppc_of_probe,
        .remove         = ehci_hcd_ppc_of_remove,
        .shutdown       = ehci_hcd_ppc_of_shutdown,
index a6f21b891f6869ec49b7e87ea502a65482ba96d6..effc58d7af8ba7492ea2490d88b452a21d442732 100644 (file)
@@ -143,15 +143,13 @@ static const struct hc_driver ehci_xilinx_of_hc_driver = {
 /**
  * ehci_hcd_xilinx_of_probe - Probe method for the USB host controller
  * @op:                pointer to the platform_device bound to the host controller
- * @match:     pointer to of_device_id structure, not used
  *
  * This function requests resources and sets up appropriate properties for the
  * host controller. Because the Xilinx USB host controller can be configured
  * as HS only or HS/FS only, it checks the configuration in the device tree
  * entry, and sets an appropriate value for hcd->has_tt.
  */
-static int __devinit
-ehci_hcd_xilinx_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op)
 {
        struct device_node *dn = op->dev.of_node;
        struct usb_hcd *hcd;
@@ -289,7 +287,7 @@ static const struct of_device_id ehci_hcd_xilinx_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match);
 
-static struct of_platform_driver ehci_hcd_xilinx_of_driver = {
+static struct platform_driver ehci_hcd_xilinx_of_driver = {
        .probe          = ehci_hcd_xilinx_of_probe,
        .remove         = ehci_hcd_xilinx_of_remove,
        .shutdown       = ehci_hcd_xilinx_of_shutdown,
index 12fd184226f248eeaec27b3222850e588410451e..b84ff7e518962bf1f9c34c781927649c76e918ac 100644 (file)
@@ -561,8 +561,7 @@ static const struct hc_driver fhci_driver = {
        .hub_control = fhci_hub_control,
 };
 
-static int __devinit of_fhci_probe(struct platform_device *ofdev,
-                                  const struct of_device_id *ofid)
+static int __devinit of_fhci_probe(struct platform_device *ofdev)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *node = dev->of_node;
@@ -812,7 +811,7 @@ static const struct of_device_id of_fhci_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_fhci_match);
 
-static struct of_platform_driver of_fhci_driver = {
+static struct platform_driver of_fhci_driver = {
        .driver = {
                .name = "fsl,usb-fhci",
                .owner = THIS_MODULE,
@@ -824,13 +823,13 @@ static struct of_platform_driver of_fhci_driver = {
 
 static int __init fhci_module_init(void)
 {
-       return of_register_platform_driver(&of_fhci_driver);
+       return platform_driver_register(&of_fhci_driver);
 }
 module_init(fhci_module_init);
 
 static void __exit fhci_module_exit(void)
 {
-       of_unregister_platform_driver(&of_fhci_driver);
+       platform_driver_unregister(&of_fhci_driver);
 }
 module_exit(fhci_module_exit);
 
index 3b28dbfca058274d607b5f309a30390d4f5bb8c3..7ee30056f3736dc5006a4cca7a903d1bef8f1ea1 100644 (file)
@@ -27,8 +27,7 @@
 #endif
 
 #ifdef CONFIG_PPC_OF
-static int of_isp1760_probe(struct platform_device *dev,
-               const struct of_device_id *match)
+static int of_isp1760_probe(struct platform_device *dev)
 {
        struct usb_hcd *hcd;
        struct device_node *dp = dev->dev.of_node;
@@ -119,7 +118,7 @@ static const struct of_device_id of_isp1760_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_isp1760_match);
 
-static struct of_platform_driver isp1760_of_driver = {
+static struct platform_driver isp1760_of_driver = {
        .driver = {
                .name = "nxp-isp1760",
                .owner = THIS_MODULE,
@@ -398,7 +397,7 @@ static int __init isp1760_init(void)
        if (!ret)
                any_ret = 0;
 #ifdef CONFIG_PPC_OF
-       ret = of_register_platform_driver(&isp1760_of_driver);
+       ret = platform_driver_register(&isp1760_of_driver);
        if (!ret)
                any_ret = 0;
 #endif
@@ -418,7 +417,7 @@ static void __exit isp1760_exit(void)
 {
        platform_driver_unregister(&isp1760_plat_driver);
 #ifdef CONFIG_PPC_OF
-       of_unregister_platform_driver(&isp1760_of_driver);
+       platform_driver_unregister(&isp1760_of_driver);
 #endif
 #ifdef CONFIG_PCI
        pci_unregister_driver(&isp1761_pci_driver);
index fb035751e4b28573e5ce37b195ea855defa9df4c..f4062bba9d04ede4bd4708efe78a2c62589965be 100644 (file)
@@ -1168,7 +1168,7 @@ static int __init ohci_hcd_mod_init(void)
 #endif
 
 #ifdef OF_PLATFORM_DRIVER
-       retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
+       retval = platform_driver_register(&OF_PLATFORM_DRIVER);
        if (retval < 0)
                goto error_of_platform;
 #endif
@@ -1227,7 +1227,7 @@ static int __init ohci_hcd_mod_init(void)
  error_sa1111:
 #endif
 #ifdef OF_PLATFORM_DRIVER
-       of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+       platform_driver_unregister(&OF_PLATFORM_DRIVER);
  error_of_platform:
 #endif
 #ifdef PLATFORM_DRIVER
@@ -1275,7 +1275,7 @@ static void __exit ohci_hcd_mod_exit(void)
        sa1111_driver_unregister(&SA1111_DRIVER);
 #endif
 #ifdef OF_PLATFORM_DRIVER
-       of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+       platform_driver_unregister(&OF_PLATFORM_DRIVER);
 #endif
 #ifdef PLATFORM_DRIVER
        platform_driver_unregister(&PLATFORM_DRIVER);
index b2c2dbf087662309738ce4f2596de1db52232ae9..1ca1821320f4116e4ec05a5d74d05eee27e68041 100644 (file)
@@ -80,8 +80,7 @@ static const struct hc_driver ohci_ppc_of_hc_driver = {
 };
 
 
-static int __devinit
-ohci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit ohci_hcd_ppc_of_probe(struct platform_device *op)
 {
        struct device_node *dn = op->dev.of_node;
        struct usb_hcd *hcd;
@@ -201,14 +200,12 @@ static int ohci_hcd_ppc_of_remove(struct platform_device *op)
        return 0;
 }
 
-static int ohci_hcd_ppc_of_shutdown(struct platform_device *op)
+static void ohci_hcd_ppc_of_shutdown(struct platform_device *op)
 {
        struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
 
         if (hcd->driver->shutdown)
                 hcd->driver->shutdown(hcd);
-
-       return 0;
 }
 
 
@@ -243,7 +240,7 @@ MODULE_DEVICE_TABLE(of, ohci_hcd_ppc_of_match);
 #endif
 
 
-static struct of_platform_driver ohci_hcd_ppc_of_driver = {
+static struct platform_driver ohci_hcd_ppc_of_driver = {
        .probe          = ohci_hcd_ppc_of_probe,
        .remove         = ohci_hcd_ppc_of_remove,
        .shutdown       = ohci_hcd_ppc_of_shutdown,
index 4dc13467281da45b87fac6e8951e4c9dc46106b5..7ba74cd4be61afced18e8a94e6ebbc57c83a00b2 100644 (file)
@@ -273,7 +273,7 @@ static int __devinit bw2_do_default_mode(struct bw2_par *par,
        return 0;
 }
 
-static int __devinit bw2_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit bw2_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -375,7 +375,7 @@ static const struct of_device_id bw2_match[] = {
 };
 MODULE_DEVICE_TABLE(of, bw2_match);
 
-static struct of_platform_driver bw2_driver = {
+static struct platform_driver bw2_driver = {
        .driver = {
                .name = "bw2",
                .owner = THIS_MODULE,
@@ -390,12 +390,12 @@ static int __init bw2_init(void)
        if (fb_get_options("bw2fb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&bw2_driver);
+       return platform_driver_register(&bw2_driver);
 }
 
 static void __exit bw2_exit(void)
 {
-       of_unregister_platform_driver(&bw2_driver);
+       platform_driver_unregister(&bw2_driver);
 }
 
 module_init(bw2_init);
index 24249535ac86abe3926759352722da54246b18a9..e2c85b0db632adb71871d3f353ee88894cf442fb 100644 (file)
@@ -463,7 +463,7 @@ static void cg14_unmap_regs(struct platform_device *op, struct fb_info *info,
                           info->screen_base, info->fix.smem_len);
 }
 
-static int __devinit cg14_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit cg14_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -595,7 +595,7 @@ static const struct of_device_id cg14_match[] = {
 };
 MODULE_DEVICE_TABLE(of, cg14_match);
 
-static struct of_platform_driver cg14_driver = {
+static struct platform_driver cg14_driver = {
        .driver = {
                .name = "cg14",
                .owner = THIS_MODULE,
@@ -610,12 +610,12 @@ static int __init cg14_init(void)
        if (fb_get_options("cg14fb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&cg14_driver);
+       return platform_driver_register(&cg14_driver);
 }
 
 static void __exit cg14_exit(void)
 {
-       of_unregister_platform_driver(&cg14_driver);
+       platform_driver_unregister(&cg14_driver);
 }
 
 module_init(cg14_init);
index 09c0c3c42482ba114e459de82dbe7d2ec8e591f0..f927a7b1a8d4c3a82df0e1c9f4ff243dccda49c0 100644 (file)
@@ -346,8 +346,7 @@ static int __devinit cg3_do_default_mode(struct cg3_par *par)
        return 0;
 }
 
-static int __devinit cg3_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit cg3_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -462,7 +461,7 @@ static const struct of_device_id cg3_match[] = {
 };
 MODULE_DEVICE_TABLE(of, cg3_match);
 
-static struct of_platform_driver cg3_driver = {
+static struct platform_driver cg3_driver = {
        .driver = {
                .name = "cg3",
                .owner = THIS_MODULE,
@@ -477,12 +476,12 @@ static int __init cg3_init(void)
        if (fb_get_options("cg3fb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&cg3_driver);
+       return platform_driver_register(&cg3_driver);
 }
 
 static void __exit cg3_exit(void)
 {
-       of_unregister_platform_driver(&cg3_driver);
+       platform_driver_unregister(&cg3_driver);
 }
 
 module_init(cg3_init);
index 2b5a97058b085f1704bfc46d46ebfe3c4278c00e..4ffad90bde4205e52d1c56a10f498677d0e21fc1 100644 (file)
@@ -737,8 +737,7 @@ static void cg6_unmap_regs(struct platform_device *op, struct fb_info *info,
                           info->fix.smem_len);
 }
 
-static int __devinit cg6_probe(struct platform_device *op,
-                               const struct of_device_id *match)
+static int __devinit cg6_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -855,7 +854,7 @@ static const struct of_device_id cg6_match[] = {
 };
 MODULE_DEVICE_TABLE(of, cg6_match);
 
-static struct of_platform_driver cg6_driver = {
+static struct platform_driver cg6_driver = {
        .driver = {
                .name = "cg6",
                .owner = THIS_MODULE,
@@ -870,12 +869,12 @@ static int __init cg6_init(void)
        if (fb_get_options("cg6fb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&cg6_driver);
+       return platform_driver_register(&cg6_driver);
 }
 
 static void __exit cg6_exit(void)
 {
-       of_unregister_platform_driver(&cg6_driver);
+       platform_driver_unregister(&cg6_driver);
 }
 
 module_init(cg6_init);
index 6739b2af3bc0fad9d4b772aed65538d166ca7588..910c5e6f67021e3281bcd10be1a5b4ef8d490e42 100644 (file)
@@ -893,8 +893,7 @@ static void ffb_init_fix(struct fb_info *info)
        info->fix.accel = FB_ACCEL_SUN_CREATOR;
 }
 
-static int __devinit ffb_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit ffb_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct ffb_fbc __iomem *fbc;
@@ -1052,7 +1051,7 @@ static const struct of_device_id ffb_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ffb_match);
 
-static struct of_platform_driver ffb_driver = {
+static struct platform_driver ffb_driver = {
        .driver = {
                .name = "ffb",
                .owner = THIS_MODULE,
@@ -1067,12 +1066,12 @@ static int __init ffb_init(void)
        if (fb_get_options("ffb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&ffb_driver);
+       return platform_driver_register(&ffb_driver);
 }
 
 static void __exit ffb_exit(void)
 {
-       of_unregister_platform_driver(&ffb_driver);
+       platform_driver_unregister(&ffb_driver);
 }
 
 module_init(ffb_init);
index 8bbbf08fa3ce0cc3d0163c9dcc1dc9f3f77cc8ad..9048f87fa8c10fd4009872dd0daae82425d1f15d 100644 (file)
@@ -1487,8 +1487,7 @@ static ssize_t show_monitor(struct device *device,
        return diu_ops.show_monitor_port(machine_data->monitor_port, buf);
 }
 
-static int __devinit fsl_diu_probe(struct platform_device *ofdev,
-       const struct of_device_id *match)
+static int __devinit fsl_diu_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct mfb_info *mfbi;
@@ -1735,7 +1734,7 @@ static struct of_device_id fsl_diu_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fsl_diu_match);
 
-static struct of_platform_driver fsl_diu_driver = {
+static struct platform_driver fsl_diu_driver = {
        .driver = {
                .name = "fsl_diu",
                .owner = THIS_MODULE,
@@ -1797,7 +1796,7 @@ static int __init fsl_diu_init(void)
        if (!coherence_data)
                return -ENOMEM;
 #endif
-       ret = of_register_platform_driver(&fsl_diu_driver);
+       ret = platform_driver_register(&fsl_diu_driver);
        if (ret) {
                printk(KERN_ERR
                        "fsl-diu: failed to register platform driver\n");
@@ -1811,7 +1810,7 @@ static int __init fsl_diu_init(void)
 
 static void __exit fsl_diu_exit(void)
 {
-       of_unregister_platform_driver(&fsl_diu_driver);
+       platform_driver_unregister(&fsl_diu_driver);
 #if defined(CONFIG_NOT_COHERENT_CACHE)
        vfree(coherence_data);
 #endif
index b599e5e36ced7708dc5269cb26b34a265263ff28..9e946e2c1da91fd67e1a3f5198f340f109f79ead 100644 (file)
@@ -547,8 +547,7 @@ static void leo_unmap_regs(struct platform_device *op, struct fb_info *info,
                of_iounmap(&op->resource[0], info->screen_base, 0x800000);
 }
 
-static int __devinit leo_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit leo_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -662,7 +661,7 @@ static const struct of_device_id leo_match[] = {
 };
 MODULE_DEVICE_TABLE(of, leo_match);
 
-static struct of_platform_driver leo_driver = {
+static struct platform_driver leo_driver = {
        .driver = {
                .name = "leo",
                .owner = THIS_MODULE,
@@ -677,12 +676,12 @@ static int __init leo_init(void)
        if (fb_get_options("leofb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&leo_driver);
+       return platform_driver_register(&leo_driver);
 }
 
 static void __exit leo_exit(void)
 {
-       of_unregister_platform_driver(&leo_driver);
+       platform_driver_unregister(&leo_driver);
 }
 
 module_init(leo_init);
index b1c4374cf9405cc5d3553b4e62eb74a8c13ff575..c76e663a6cd41a6ab43721174bf5e08b0cb0f095 100644 (file)
@@ -550,8 +550,7 @@ static int mb862xx_gdc_init(struct mb862xxfb_par *par)
        return 0;
 }
 
-static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev,
-                                              const struct of_device_id *id)
+static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev)
 {
        struct device_node *np = ofdev->dev.of_node;
        struct device *dev = &ofdev->dev;
@@ -717,7 +716,7 @@ static struct of_device_id __devinitdata of_platform_mb862xx_tbl[] = {
        { /* end */ }
 };
 
-static struct of_platform_driver of_platform_mb862xxfb_driver = {
+static struct platform_driver of_platform_mb862xxfb_driver = {
        .driver = {
                .name = DRV_NAME,
                .owner = THIS_MODULE,
@@ -1038,7 +1037,7 @@ static int __devinit mb862xxfb_init(void)
        int ret = -ENODEV;
 
 #if defined(CONFIG_FB_MB862XX_LIME)
-       ret = of_register_platform_driver(&of_platform_mb862xxfb_driver);
+       ret = platform_driver_register(&of_platform_mb862xxfb_driver);
 #endif
 #if defined(CONFIG_FB_MB862XX_PCI_GDC)
        ret = pci_register_driver(&mb862xxfb_pci_driver);
@@ -1049,7 +1048,7 @@ static int __devinit mb862xxfb_init(void)
 static void __exit mb862xxfb_exit(void)
 {
 #if defined(CONFIG_FB_MB862XX_LIME)
-       of_unregister_platform_driver(&of_platform_mb862xxfb_driver);
+       platform_driver_unregister(&of_platform_mb862xxfb_driver);
 #endif
 #if defined(CONFIG_FB_MB862XX_PCI_GDC)
        pci_unregister_driver(&mb862xxfb_pci_driver);
index b6c3fc2db6328a2f187e7a35f1ac8448a3abeebd..d57cc58c5168c8948b6c62d01800fa40503f6638 100644 (file)
@@ -249,7 +249,7 @@ static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_no
        info->fix.accel = FB_ACCEL_SUN_CGTHREE;
 }
 
-static int __devinit p9100_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit p9100_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -352,7 +352,7 @@ static const struct of_device_id p9100_match[] = {
 };
 MODULE_DEVICE_TABLE(of, p9100_match);
 
-static struct of_platform_driver p9100_driver = {
+static struct platform_driver p9100_driver = {
        .driver = {
                .name = "p9100",
                .owner = THIS_MODULE,
@@ -367,12 +367,12 @@ static int __init p9100_init(void)
        if (fb_get_options("p9100fb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&p9100_driver);
+       return platform_driver_register(&p9100_driver);
 }
 
 static void __exit p9100_exit(void)
 {
-       of_unregister_platform_driver(&p9100_driver);
+       platform_driver_unregister(&p9100_driver);
 }
 
 module_init(p9100_init);
index a50e1977b31637af3204788262bc04776e91b39b..ef532d9d3c99d9376e8c5c260eda261f46c203c5 100644 (file)
@@ -533,8 +533,7 @@ static int __init platinumfb_setup(char *options)
 #define invalidate_cache(addr)
 #endif
 
-static int __devinit platinumfb_probe(struct platform_device* odev,
-                                     const struct of_device_id *match)
+static int __devinit platinumfb_probe(struct platform_device* odev)
 {
        struct device_node      *dp = odev->dev.of_node;
        struct fb_info          *info;
@@ -677,7 +676,7 @@ static struct of_device_id platinumfb_match[] =
        {},
 };
 
-static struct of_platform_driver platinum_driver = 
+static struct platform_driver platinum_driver = 
 {
        .driver = {
                .name = "platinumfb",
@@ -697,14 +696,14 @@ static int __init platinumfb_init(void)
                return -ENODEV;
        platinumfb_setup(option);
 #endif
-       of_register_platform_driver(&platinum_driver);
+       platform_driver_register(&platinum_driver);
 
        return 0;
 }
 
 static void __exit platinumfb_exit(void)
 {
-       of_unregister_platform_driver(&platinum_driver);
+       platform_driver_unregister(&platinum_driver);
 }
 
 MODULE_LICENSE("GPL");
index 5dbe06af2226f3db9433a27dc3c3b5593c278e95..b7f27acaf817075e0ccde9e8108e296c2184f792 100644 (file)
@@ -111,8 +111,7 @@ static int __devinit gfb_set_fbinfo(struct gfb_info *gp)
         return 0;
 }
 
-static int __devinit gfb_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit gfb_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -198,7 +197,7 @@ static const struct of_device_id gfb_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ffb_match);
 
-static struct of_platform_driver gfb_driver = {
+static struct platform_driver gfb_driver = {
        .probe          = gfb_probe,
        .remove         = __devexit_p(gfb_remove),
        .driver = {
@@ -213,12 +212,12 @@ static int __init gfb_init(void)
        if (fb_get_options("gfb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&gfb_driver);
+       return platform_driver_register(&gfb_driver);
 }
 
 static void __exit gfb_exit(void)
 {
-       of_unregister_platform_driver(&gfb_driver);
+       platform_driver_unregister(&gfb_driver);
 }
 
 module_init(gfb_init);
index 77ad27955cf0422b5c137754593ecfd00e680a31..855b71993f61f9cb0f10822c9dd810375178bcc5 100644 (file)
@@ -362,8 +362,7 @@ static void tcx_unmap_regs(struct platform_device *op, struct fb_info *info,
                           info->screen_base, info->fix.smem_len);
 }
 
-static int __devinit tcx_probe(struct platform_device *op,
-                              const struct of_device_id *match)
+static int __devinit tcx_probe(struct platform_device *op)
 {
        struct device_node *dp = op->dev.of_node;
        struct fb_info *info;
@@ -511,7 +510,7 @@ static const struct of_device_id tcx_match[] = {
 };
 MODULE_DEVICE_TABLE(of, tcx_match);
 
-static struct of_platform_driver tcx_driver = {
+static struct platform_driver tcx_driver = {
        .driver = {
                .name = "tcx",
                .owner = THIS_MODULE,
@@ -526,12 +525,12 @@ static int __init tcx_init(void)
        if (fb_get_options("tcxfb", NULL))
                return -ENODEV;
 
-       return of_register_platform_driver(&tcx_driver);
+       return platform_driver_register(&tcx_driver);
 }
 
 static void __exit tcx_exit(void)
 {
-       of_unregister_platform_driver(&tcx_driver);
+       platform_driver_unregister(&tcx_driver);
 }
 
 module_init(tcx_init);
index 68bd23476c64087b34a8cf22d5da491f7e635d9f..77dea015ff69a7524261296ea91ed33975b338a9 100644 (file)
@@ -404,8 +404,7 @@ static int xilinxfb_release(struct device *dev)
  * OF bus binding
  */
 
-static int __devinit
-xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit xilinxfb_of_probe(struct platform_device *op)
 {
        const u32 *prop;
        u32 *p;
@@ -418,8 +417,6 @@ xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
        /* Copy with the default pdata (not a ptr reference!) */
        pdata = xilinx_fb_default_pdata;
 
-       dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match);
-
        /* Allocate the driver data region */
        drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
        if (!drvdata) {
@@ -505,7 +502,7 @@ static struct of_device_id xilinxfb_of_match[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
 
-static struct of_platform_driver xilinxfb_of_driver = {
+static struct platform_driver xilinxfb_of_driver = {
        .probe = xilinxfb_of_probe,
        .remove = __devexit_p(xilinxfb_of_remove),
        .driver = {
@@ -523,13 +520,13 @@ static struct of_platform_driver xilinxfb_of_driver = {
 static int __init
 xilinxfb_init(void)
 {
-       return of_register_platform_driver(&xilinxfb_of_driver);
+       return platform_driver_register(&xilinxfb_of_driver);
 }
 
 static void __exit
 xilinxfb_cleanup(void)
 {
-       of_unregister_platform_driver(&xilinxfb_of_driver);
+       platform_driver_unregister(&xilinxfb_of_driver);
 }
 
 module_init(xilinxfb_init);
index 3de4ba0260a50f482a12d0869b35287592cd4ff0..65911678453d0633f21afe611d21cb693cb07bb9 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);
index dba775a68752685e4f02eae24db4ddd63d2e8512..144ec135875fb06e66f08292681103825ccbfb2c 100644 (file)
@@ -442,6 +442,7 @@ struct device {
        struct dev_archdata     archdata;
 
        struct device_node      *of_node; /* associated device tree node */
+       const struct of_device_id *of_match; /* matching of_device_id from driver */
 
        dev_t                   devt;   /* dev_t, creates the sysfs "dev" */
 
index 266db1d0baa9d994c20b4665a774a8f96f3646cd..bfc0ed1b0ced1405a5d6544a4a855f2a94e00326 100644 (file)
@@ -108,7 +108,7 @@ extern void of_node_put(struct device_node *node);
 #endif
 
 /*
- * OF address retreival & translation
+ * OF address retrieval & translation
  */
 
 /* Helper to read a big number; size is in cells (not bytes) */
index 975d347079d95ee7015e976a95888951c348a538..8bfe6c1d43654069b8fa2e1bbc61ab4d34dd4d22 100644 (file)
@@ -18,10 +18,11 @@ extern void of_device_make_bus_id(struct device *dev);
  * @drv: the device_driver structure to test
  * @dev: the device structure to match against
  */
-static inline int of_driver_match_device(const struct device *dev,
+static inline int of_driver_match_device(struct device *dev,
                                         const struct device_driver *drv)
 {
-       return of_match_device(drv->of_match_table, dev) != NULL;
+       dev->of_match = of_match_device(drv->of_match_table, dev);
+       return dev->of_match != NULL;
 }
 
 extern struct platform_device *of_dev_get(struct platform_device *dev);
index a68716ad38ced8a7535cddfd7631a35ce0e74ddb..17c7e21c0bd7745a383ce1dddd9269c75214ae90 100644 (file)
  * of_platform_driver - Legacy of-aware driver for platform devices.
  *
  * An of_platform_driver driver is attached to a basic platform_device on
- * ether the "platform bus" (platform_bus_type), or the ibm ebus
- * (ibmebus_bus_type).
- *
- * of_platform_driver is being phased out when used with the platform_bus_type,
- * and regular platform_drivers should be used instead.  When the transition
- * is complete, only ibmebus will be using this structure, and the
- * platform_driver member of this structure will be removed.
+ * the ibm ebus (ibmebus_bus_type).
  */
 struct of_platform_driver
 {
@@ -42,26 +36,16 @@ struct of_platform_driver
        int     (*shutdown)(struct platform_device* dev);
 
        struct device_driver    driver;
-       struct platform_driver  platform_driver;
 };
 #define        to_of_platform_driver(drv) \
        container_of(drv,struct of_platform_driver, driver)
 
-extern int of_register_driver(struct of_platform_driver *drv,
-                             struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
-
 /* Platform drivers register/unregister */
-extern int of_register_platform_driver(struct of_platform_driver *drv);
-extern void of_unregister_platform_driver(struct of_platform_driver *drv);
-
 extern struct platform_device *of_device_alloc(struct device_node *np,
                                         const char *bus_id,
                                         struct device *parent);
 extern struct platform_device *of_find_device_by_node(struct device_node *np);
 
-extern int of_bus_type_init(struct bus_type *bus, const char *name);
-
 #if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */
 /* Platform devices and busses creation */
 extern struct platform_device *of_platform_device_create(struct device_node *np,
index 4cf98c03af223cda837a25a6f0c98c8eb0071025..15dac0f20cd8aa9a37221acc3367fa269142fc5a 100644 (file)
@@ -896,8 +896,7 @@ static struct snd_pcm_ops fsl_dma_ops = {
        .pointer        = fsl_dma_pointer,
 };
 
-static int __devinit fsl_soc_dma_probe(struct platform_device *pdev,
-                                      const struct of_device_id *match)
+static int __devinit fsl_soc_dma_probe(struct platform_device *pdev)
  {
        struct dma_object *dma;
        struct device_node *np = pdev->dev.of_node;
@@ -979,7 +978,7 @@ static const struct of_device_id fsl_soc_dma_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, fsl_soc_dma_ids);
 
-static struct of_platform_driver fsl_soc_dma_driver = {
+static struct platform_driver fsl_soc_dma_driver = {
        .driver = {
                .name = "fsl-pcm-audio",
                .owner = THIS_MODULE,
@@ -993,12 +992,12 @@ static int __init fsl_soc_dma_init(void)
 {
        pr_info("Freescale Elo DMA ASoC PCM Driver\n");
 
-       return of_register_platform_driver(&fsl_soc_dma_driver);
+       return platform_driver_register(&fsl_soc_dma_driver);
 }
 
 static void __exit fsl_soc_dma_exit(void)
 {
-       of_unregister_platform_driver(&fsl_soc_dma_driver);
+       platform_driver_unregister(&fsl_soc_dma_driver);
 }
 
 module_init(fsl_soc_dma_init);
index 4cc167a7aeb82d411306f23634891aeb3ca6da79..313e0ccedd5b6ad64d270367a4e40ac78f80adf8 100644 (file)
@@ -624,8 +624,7 @@ static void make_lowercase(char *s)
        }
 }
 
-static int __devinit fsl_ssi_probe(struct platform_device *pdev,
-                                  const struct of_device_id *match)
+static int __devinit fsl_ssi_probe(struct platform_device *pdev)
 {
        struct fsl_ssi_private *ssi_private;
        int ret = 0;
@@ -774,7 +773,7 @@ static const struct of_device_id fsl_ssi_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
 
-static struct of_platform_driver fsl_ssi_driver = {
+static struct platform_driver fsl_ssi_driver = {
        .driver = {
                .name = "fsl-ssi-dai",
                .owner = THIS_MODULE,
@@ -788,12 +787,12 @@ static int __init fsl_ssi_init(void)
 {
        printk(KERN_INFO "Freescale Synchronous Serial Interface (SSI) ASoC Driver\n");
 
-       return of_register_platform_driver(&fsl_ssi_driver);
+       return platform_driver_register(&fsl_ssi_driver);
 }
 
 static void __exit fsl_ssi_exit(void)
 {
-       of_unregister_platform_driver(&fsl_ssi_driver);
+       platform_driver_unregister(&fsl_ssi_driver);
 }
 
 module_init(fsl_ssi_init);
index f92dca07cd35ffdcb46bb16e7c0a4f6db8bc29fe..fff695ccdd3eecff34446a6df4d7915f0fc4964b 100644 (file)
@@ -368,8 +368,7 @@ static struct snd_soc_platform_driver mpc5200_audio_dma_platform = {
        .pcm_free       = &psc_dma_free,
 };
 
-static int mpc5200_hpcd_probe(struct of_device *op,
-               const struct of_device_id *match)
+static int mpc5200_hpcd_probe(struct of_device *op)
 {
        phys_addr_t fifo;
        struct psc_dma *psc_dma;
@@ -511,32 +510,31 @@ static int mpc5200_hpcd_remove(struct of_device *op)
 }
 
 static struct of_device_id mpc5200_hpcd_match[] = {
-       {
-               .compatible = "fsl,mpc5200-pcm",
-       },
+       { .compatible = "fsl,mpc5200-pcm", },
        {}
 };
 MODULE_DEVICE_TABLE(of, mpc5200_hpcd_match);
 
-static struct of_platform_driver mpc5200_hpcd_of_driver = {
-       .owner          = THIS_MODULE,
-       .name           = "mpc5200-pcm-audio",
-       .match_table    = mpc5200_hpcd_match,
+static struct platform_driver mpc5200_hpcd_of_driver = {
        .probe          = mpc5200_hpcd_probe,
        .remove         = mpc5200_hpcd_remove,
+       .dev = {
+               .owner          = THIS_MODULE,
+               .name           = "mpc5200-pcm-audio",
+               .of_match_table    = mpc5200_hpcd_match,
+       }
 };
 
 static int __init mpc5200_hpcd_init(void)
 {
-       return of_register_platform_driver(&mpc5200_hpcd_of_driver);
+       return platform_driver_register(&mpc5200_hpcd_of_driver);
 }
+module_init(mpc5200_hpcd_init);
 
 static void __exit mpc5200_hpcd_exit(void)
 {
-       of_unregister_platform_driver(&mpc5200_hpcd_of_driver);
+       platform_driver_unregister(&mpc5200_hpcd_of_driver);
 }
-
-module_init(mpc5200_hpcd_init);
 module_exit(mpc5200_hpcd_exit);
 
 MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
index 40acc8e2b1cac1a36ba8a94d11dccd9d10129e55..ad36b095bb79ce268ba754a2dbe95446b510efc4 100644 (file)
@@ -272,8 +272,7 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = {
  * - Probe/remove operations
  * - OF device match table
  */
-static int __devinit psc_ac97_of_probe(struct platform_device *op,
-                                     const struct of_device_id *match)
+static int __devinit psc_ac97_of_probe(struct platform_device *op)
 {
        int rc;
        struct snd_ac97 ac97;
@@ -316,7 +315,7 @@ static struct of_device_id psc_ac97_match[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(of, psc_ac97_match);
 
-static struct of_platform_driver psc_ac97_driver = {
+static struct platform_driver psc_ac97_driver = {
        .probe = psc_ac97_of_probe,
        .remove = __devexit_p(psc_ac97_of_remove),
        .driver = {
@@ -332,13 +331,13 @@ static struct of_platform_driver psc_ac97_driver = {
  */
 static int __init psc_ac97_init(void)
 {
-       return of_register_platform_driver(&psc_ac97_driver);
+       return platform_driver_register(&psc_ac97_driver);
 }
 module_init(psc_ac97_init);
 
 static void __exit psc_ac97_exit(void)
 {
-       of_unregister_platform_driver(&psc_ac97_driver);
+       platform_driver_unregister(&psc_ac97_driver);
 }
 module_exit(psc_ac97_exit);
 
index 9018fa5bf0db8db93737ef946073613f20b279df..87cf2a5c2b2c2957e77fb17e94fa36038e6e318c 100644 (file)
@@ -150,8 +150,7 @@ static struct snd_soc_dai_driver psc_i2s_dai[] = {{
  * - Probe/remove operations
  * - OF device match table
  */
-static int __devinit psc_i2s_of_probe(struct platform_device *op,
-                                     const struct of_device_id *match)
+static int __devinit psc_i2s_of_probe(struct platform_device *op)
 {
        int rc;
        struct psc_dma *psc_dma;
@@ -213,7 +212,7 @@ static struct of_device_id psc_i2s_match[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(of, psc_i2s_match);
 
-static struct of_platform_driver psc_i2s_driver = {
+static struct platform_driver psc_i2s_driver = {
        .probe = psc_i2s_of_probe,
        .remove = __devexit_p(psc_i2s_of_remove),
        .driver = {
@@ -229,13 +228,13 @@ static struct of_platform_driver psc_i2s_driver = {
  */
 static int __init psc_i2s_init(void)
 {
-       return of_register_platform_driver(&psc_i2s_driver);
+       return platform_driver_register(&psc_i2s_driver);
 }
 module_init(psc_i2s_init);
 
 static void __exit psc_i2s_exit(void)
 {
-       of_unregister_platform_driver(&psc_i2s_driver);
+       platform_driver_unregister(&psc_i2s_driver);
 }
 module_exit(psc_i2s_exit);
 
index f8bcfc30f800bb9c15e669597d240090de015ac9..ad7d4d7d923741d7b75852857db0e1fad15d67f1 100644 (file)
@@ -1002,7 +1002,7 @@ static int __devinit snd_amd7930_create(struct snd_card *card,
        return 0;
 }
 
-static int __devinit amd7930_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit amd7930_sbus_probe(struct platform_device *op)
 {
        struct resource *rp = &op->resource[0];
        static int dev_num;
@@ -1064,7 +1064,7 @@ static const struct of_device_id amd7930_match[] = {
        {},
 };
 
-static struct of_platform_driver amd7930_sbus_driver = {
+static struct platform_driver amd7930_sbus_driver = {
        .driver = {
                .name = "audio",
                .owner = THIS_MODULE,
@@ -1075,7 +1075,7 @@ static struct of_platform_driver amd7930_sbus_driver = {
 
 static int __init amd7930_init(void)
 {
-       return of_register_platform_driver(&amd7930_sbus_driver);
+       return platform_driver_register(&amd7930_sbus_driver);
 }
 
 static void __exit amd7930_exit(void)
@@ -1092,7 +1092,7 @@ static void __exit amd7930_exit(void)
 
        amd7930_list = NULL;
 
-       of_unregister_platform_driver(&amd7930_sbus_driver);
+       platform_driver_unregister(&amd7930_sbus_driver);
 }
 
 module_init(amd7930_init);
index c276086c3b5783bc32ae28ffbac8cd9c3fc9473d..0e618f82808cc1c590a3a62f5341059c301a2d25 100644 (file)
@@ -1856,7 +1856,7 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
        return 0;
 }
 
-static int __devinit cs4231_sbus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit cs4231_sbus_probe(struct platform_device *op)
 {
        struct resource *rp = &op->resource[0];
        struct snd_card *card;
@@ -2048,7 +2048,7 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
        return 0;
 }
 
-static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit cs4231_ebus_probe(struct platform_device *op)
 {
        struct snd_card *card;
        int err;
@@ -2072,16 +2072,16 @@ static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct
 }
 #endif
 
-static int __devinit cs4231_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit cs4231_probe(struct platform_device *op)
 {
 #ifdef EBUS_SUPPORT
        if (!strcmp(op->dev.of_node->parent->name, "ebus"))
-               return cs4231_ebus_probe(op, match);
+               return cs4231_ebus_probe(op);
 #endif
 #ifdef SBUS_SUPPORT
        if (!strcmp(op->dev.of_node->parent->name, "sbus") ||
            !strcmp(op->dev.of_node->parent->name, "sbi"))
-               return cs4231_sbus_probe(op, match);
+               return cs4231_sbus_probe(op);
 #endif
        return -ENODEV;
 }
@@ -2108,7 +2108,7 @@ static const struct of_device_id cs4231_match[] = {
 
 MODULE_DEVICE_TABLE(of, cs4231_match);
 
-static struct of_platform_driver cs4231_driver = {
+static struct platform_driver cs4231_driver = {
        .driver = {
                .name = "audio",
                .owner = THIS_MODULE,
@@ -2120,12 +2120,12 @@ static struct of_platform_driver cs4231_driver = {
 
 static int __init cs4231_init(void)
 {
-       return of_register_platform_driver(&cs4231_driver);
+       return platform_driver_register(&cs4231_driver);
 }
 
 static void __exit cs4231_exit(void)
 {
-       of_unregister_platform_driver(&cs4231_driver);
+       platform_driver_unregister(&cs4231_driver);
 }
 
 module_init(cs4231_init);
index 39cd5d69d051a413c6ad77305fef201acfd37605..73f9cbacc0775bbc9cb1cf8f36f187e5606e8486 100644 (file)
@@ -2592,7 +2592,7 @@ static void snd_dbri_free(struct snd_dbri *dbri)
                                  (void *)dbri->dma, dbri->dma_dvma);
 }
 
-static int __devinit dbri_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit dbri_probe(struct platform_device *op)
 {
        struct snd_dbri *dbri;
        struct resource *rp;
@@ -2686,7 +2686,7 @@ static const struct of_device_id dbri_match[] = {
 
 MODULE_DEVICE_TABLE(of, dbri_match);
 
-static struct of_platform_driver dbri_sbus_driver = {
+static struct platform_driver dbri_sbus_driver = {
        .driver = {
                .name = "dbri",
                .owner = THIS_MODULE,
@@ -2699,12 +2699,12 @@ static struct of_platform_driver dbri_sbus_driver = {
 /* Probe for the dbri chip and then attach the driver. */
 static int __init dbri_init(void)
 {
-       return of_register_platform_driver(&dbri_sbus_driver);
+       return platform_driver_register(&dbri_sbus_driver);
 }
 
 static void __exit dbri_exit(void)
 {
-       of_unregister_platform_driver(&dbri_sbus_driver);
+       platform_driver_unregister(&dbri_sbus_driver);
 }
 
 module_init(dbri_init);
This page took 0.192528 seconds and 5 git commands to generate.