]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ibmebus: convert of_platform_driver to platform_driver
authorRob Herring <rob.herring@calxeda.com>
Sun, 21 Apr 2013 02:51:08 +0000 (21:51 -0500)
committerGrant Likely <grant.likely@linaro.org>
Wed, 12 Jun 2013 11:37:26 +0000 (12:37 +0100)
ibmebus is the last remaining user of of_platform_driver and the
conversion to a regular platform driver is trivial.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
arch/powerpc/include/asm/ibmebus.h
arch/powerpc/kernel/ibmebus.c
drivers/infiniband/hw/ehca/ehca_main.c
drivers/net/ethernet/ibm/ehea/ehea_main.c

index 1a9d9aea21fa7e3059e428e341bebd18a0a1c621..088f95b2e14f9a1b3be73faeb0c98d5c48b7d58a 100644 (file)
@@ -48,8 +48,8 @@
 
 extern struct bus_type ibmebus_bus_type;
 
-int ibmebus_register_driver(struct of_platform_driver *drv);
-void ibmebus_unregister_driver(struct of_platform_driver *drv);
+int ibmebus_register_driver(struct platform_driver *drv);
+void ibmebus_unregister_driver(struct platform_driver *drv);
 
 int ibmebus_request_irq(u32 ist, irq_handler_t handler,
                        unsigned long irq_flags, const char *devname,
index 8220baa46faf8ced3c383bb5de46b310b802cbbf..16a7c2326d48d217b3f163777f3cfc473bb02fe1 100644 (file)
@@ -205,7 +205,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
        return ret;
 }
 
-int ibmebus_register_driver(struct of_platform_driver *drv)
+int ibmebus_register_driver(struct platform_driver *drv)
 {
        /* If the driver uses devices that ibmebus doesn't know, add them */
        ibmebus_create_devices(drv->driver.of_match_table);
@@ -215,7 +215,7 @@ int ibmebus_register_driver(struct of_platform_driver *drv)
 }
 EXPORT_SYMBOL(ibmebus_register_driver);
 
-void ibmebus_unregister_driver(struct of_platform_driver *drv)
+void ibmebus_unregister_driver(struct platform_driver *drv)
 {
        driver_unregister(&drv->driver);
 }
@@ -338,11 +338,10 @@ static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv)
 static int ibmebus_bus_device_probe(struct device *dev)
 {
        int error = -ENODEV;
-       struct of_platform_driver *drv;
+       struct platform_driver *drv;
        struct platform_device *of_dev;
-       const struct of_device_id *match;
 
-       drv = to_of_platform_driver(dev->driver);
+       drv = to_platform_driver(dev->driver);
        of_dev = to_platform_device(dev);
 
        if (!drv->probe)
@@ -350,9 +349,8 @@ static int ibmebus_bus_device_probe(struct device *dev)
 
        of_dev_get(of_dev);
 
-       match = of_match_device(drv->driver.of_match_table, dev);
-       if (match)
-               error = drv->probe(of_dev, match);
+       if (of_driver_match_device(dev, dev->driver))
+               error = drv->probe(of_dev);
        if (error)
                of_dev_put(of_dev);
 
@@ -362,7 +360,7 @@ static int ibmebus_bus_device_probe(struct device *dev)
 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);
+       struct platform_driver *drv = to_platform_driver(dev->driver);
 
        if (dev->driver && drv->remove)
                drv->remove(of_dev);
@@ -372,7 +370,7 @@ static int ibmebus_bus_device_remove(struct device *dev)
 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);
+       struct platform_driver *drv = to_platform_driver(dev->driver);
 
        if (dev->driver && drv->shutdown)
                drv->shutdown(of_dev);
@@ -419,7 +417,7 @@ struct device_attribute ibmebus_bus_device_attrs[] = {
 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);
+       struct platform_driver *drv = to_platform_driver(dev->driver);
        int ret = 0;
 
        if (dev->driver && drv->suspend)
@@ -430,7 +428,7 @@ static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg)
 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);
+       struct platform_driver *drv = to_platform_driver(dev->driver);
        int ret = 0;
 
        if (dev->driver && drv->resume)
index f8a62918a88d58ef8609899ce06629175c0775bd..982e3efd98d3ef6d1f6c3cbce6b894e494c0f870 100644 (file)
@@ -713,8 +713,7 @@ static struct attribute_group ehca_dev_attr_grp = {
        .attrs = ehca_dev_attrs
 };
 
-static int ehca_probe(struct platform_device *dev,
-                     const struct of_device_id *id)
+static int ehca_probe(struct platform_device *dev)
 {
        struct ehca_shca *shca;
        const u64 *handle;
@@ -937,7 +936,7 @@ static struct of_device_id ehca_device_table[] =
 };
 MODULE_DEVICE_TABLE(of, ehca_device_table);
 
-static struct of_platform_driver ehca_driver = {
+static struct platform_driver ehca_driver = {
        .probe       = ehca_probe,
        .remove      = ehca_remove,
        .driver = {
index 90ea0b1673ca45300f902f0f038f0a4a7061b745..de2969cae2625ad7fa585b1b702b34987000817f 100644 (file)
@@ -98,8 +98,7 @@ static struct ehea_fw_handle_array ehea_fw_handles;
 static struct ehea_bcmc_reg_array ehea_bcmc_regs;
 
 
-static int ehea_probe_adapter(struct platform_device *dev,
-                             const struct of_device_id *id);
+static int ehea_probe_adapter(struct platform_device *dev);
 
 static int ehea_remove(struct platform_device *dev);
 
@@ -112,7 +111,7 @@ static struct of_device_id ehea_device_table[] = {
 };
 MODULE_DEVICE_TABLE(of, ehea_device_table);
 
-static struct of_platform_driver ehea_driver = {
+static struct platform_driver ehea_driver = {
        .driver = {
                .name = "ehea",
                .owner = THIS_MODULE,
@@ -3251,8 +3250,7 @@ static void ehea_remove_device_sysfs(struct platform_device *dev)
        device_remove_file(&dev->dev, &dev_attr_remove_port);
 }
 
-static int ehea_probe_adapter(struct platform_device *dev,
-                             const struct of_device_id *id)
+static int ehea_probe_adapter(struct platform_device *dev)
 {
        struct ehea_adapter *adapter;
        const u64 *adapter_handle;