diff options
author | Rob Herring <rob.herring@calxeda.com> | 2013-04-20 22:51:08 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-06-12 07:37:26 -0400 |
commit | c45640e4a9f54f2f6f4bc51c2ba9644ffb3babde (patch) | |
tree | 34e8f3abdc997feb2953b915334e9dd2015a3bf4 | |
parent | 10dbc5e39a60944536f3ca59bc9a8a8896355714 (diff) |
ibmebus: convert of_platform_driver to platform_driver
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>
-rw-r--r-- | arch/powerpc/include/asm/ibmebus.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 22 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/ibm/ehea/ehea_main.c | 8 |
4 files changed, 17 insertions, 22 deletions
diff --git a/arch/powerpc/include/asm/ibmebus.h b/arch/powerpc/include/asm/ibmebus.h index 1a9d9aea21fa..088f95b2e14f 100644 --- a/arch/powerpc/include/asm/ibmebus.h +++ b/arch/powerpc/include/asm/ibmebus.h | |||
@@ -48,8 +48,8 @@ | |||
48 | 48 | ||
49 | extern struct bus_type ibmebus_bus_type; | 49 | extern struct bus_type ibmebus_bus_type; |
50 | 50 | ||
51 | int ibmebus_register_driver(struct of_platform_driver *drv); | 51 | int ibmebus_register_driver(struct platform_driver *drv); |
52 | void ibmebus_unregister_driver(struct of_platform_driver *drv); | 52 | void ibmebus_unregister_driver(struct platform_driver *drv); |
53 | 53 | ||
54 | int ibmebus_request_irq(u32 ist, irq_handler_t handler, | 54 | int ibmebus_request_irq(u32 ist, irq_handler_t handler, |
55 | unsigned long irq_flags, const char *devname, | 55 | unsigned long irq_flags, const char *devname, |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 8220baa46faf..16a7c2326d48 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -205,7 +205,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches) | |||
205 | return ret; | 205 | return ret; |
206 | } | 206 | } |
207 | 207 | ||
208 | int ibmebus_register_driver(struct of_platform_driver *drv) | 208 | int ibmebus_register_driver(struct platform_driver *drv) |
209 | { | 209 | { |
210 | /* If the driver uses devices that ibmebus doesn't know, add them */ | 210 | /* If the driver uses devices that ibmebus doesn't know, add them */ |
211 | ibmebus_create_devices(drv->driver.of_match_table); | 211 | ibmebus_create_devices(drv->driver.of_match_table); |
@@ -215,7 +215,7 @@ int ibmebus_register_driver(struct of_platform_driver *drv) | |||
215 | } | 215 | } |
216 | EXPORT_SYMBOL(ibmebus_register_driver); | 216 | EXPORT_SYMBOL(ibmebus_register_driver); |
217 | 217 | ||
218 | void ibmebus_unregister_driver(struct of_platform_driver *drv) | 218 | void ibmebus_unregister_driver(struct platform_driver *drv) |
219 | { | 219 | { |
220 | driver_unregister(&drv->driver); | 220 | driver_unregister(&drv->driver); |
221 | } | 221 | } |
@@ -338,11 +338,10 @@ static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv) | |||
338 | static int ibmebus_bus_device_probe(struct device *dev) | 338 | static int ibmebus_bus_device_probe(struct device *dev) |
339 | { | 339 | { |
340 | int error = -ENODEV; | 340 | int error = -ENODEV; |
341 | struct of_platform_driver *drv; | 341 | struct platform_driver *drv; |
342 | struct platform_device *of_dev; | 342 | struct platform_device *of_dev; |
343 | const struct of_device_id *match; | ||
344 | 343 | ||
345 | drv = to_of_platform_driver(dev->driver); | 344 | drv = to_platform_driver(dev->driver); |
346 | of_dev = to_platform_device(dev); | 345 | of_dev = to_platform_device(dev); |
347 | 346 | ||
348 | if (!drv->probe) | 347 | if (!drv->probe) |
@@ -350,9 +349,8 @@ static int ibmebus_bus_device_probe(struct device *dev) | |||
350 | 349 | ||
351 | of_dev_get(of_dev); | 350 | of_dev_get(of_dev); |
352 | 351 | ||
353 | match = of_match_device(drv->driver.of_match_table, dev); | 352 | if (of_driver_match_device(dev, dev->driver)) |
354 | if (match) | 353 | error = drv->probe(of_dev); |
355 | error = drv->probe(of_dev, match); | ||
356 | if (error) | 354 | if (error) |
357 | of_dev_put(of_dev); | 355 | of_dev_put(of_dev); |
358 | 356 | ||
@@ -362,7 +360,7 @@ static int ibmebus_bus_device_probe(struct device *dev) | |||
362 | static int ibmebus_bus_device_remove(struct device *dev) | 360 | static int ibmebus_bus_device_remove(struct device *dev) |
363 | { | 361 | { |
364 | struct platform_device *of_dev = to_platform_device(dev); | 362 | struct platform_device *of_dev = to_platform_device(dev); |
365 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 363 | struct platform_driver *drv = to_platform_driver(dev->driver); |
366 | 364 | ||
367 | if (dev->driver && drv->remove) | 365 | if (dev->driver && drv->remove) |
368 | drv->remove(of_dev); | 366 | drv->remove(of_dev); |
@@ -372,7 +370,7 @@ static int ibmebus_bus_device_remove(struct device *dev) | |||
372 | static void ibmebus_bus_device_shutdown(struct device *dev) | 370 | static void ibmebus_bus_device_shutdown(struct device *dev) |
373 | { | 371 | { |
374 | struct platform_device *of_dev = to_platform_device(dev); | 372 | struct platform_device *of_dev = to_platform_device(dev); |
375 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 373 | struct platform_driver *drv = to_platform_driver(dev->driver); |
376 | 374 | ||
377 | if (dev->driver && drv->shutdown) | 375 | if (dev->driver && drv->shutdown) |
378 | drv->shutdown(of_dev); | 376 | drv->shutdown(of_dev); |
@@ -419,7 +417,7 @@ struct device_attribute ibmebus_bus_device_attrs[] = { | |||
419 | static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) | 417 | static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) |
420 | { | 418 | { |
421 | struct platform_device *of_dev = to_platform_device(dev); | 419 | struct platform_device *of_dev = to_platform_device(dev); |
422 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 420 | struct platform_driver *drv = to_platform_driver(dev->driver); |
423 | int ret = 0; | 421 | int ret = 0; |
424 | 422 | ||
425 | if (dev->driver && drv->suspend) | 423 | if (dev->driver && drv->suspend) |
@@ -430,7 +428,7 @@ static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) | |||
430 | static int ibmebus_bus_legacy_resume(struct device *dev) | 428 | static int ibmebus_bus_legacy_resume(struct device *dev) |
431 | { | 429 | { |
432 | struct platform_device *of_dev = to_platform_device(dev); | 430 | struct platform_device *of_dev = to_platform_device(dev); |
433 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 431 | struct platform_driver *drv = to_platform_driver(dev->driver); |
434 | int ret = 0; | 432 | int ret = 0; |
435 | 433 | ||
436 | if (dev->driver && drv->resume) | 434 | if (dev->driver && drv->resume) |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index f8a62918a88d..982e3efd98d3 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -713,8 +713,7 @@ static struct attribute_group ehca_dev_attr_grp = { | |||
713 | .attrs = ehca_dev_attrs | 713 | .attrs = ehca_dev_attrs |
714 | }; | 714 | }; |
715 | 715 | ||
716 | static int ehca_probe(struct platform_device *dev, | 716 | static int ehca_probe(struct platform_device *dev) |
717 | const struct of_device_id *id) | ||
718 | { | 717 | { |
719 | struct ehca_shca *shca; | 718 | struct ehca_shca *shca; |
720 | const u64 *handle; | 719 | const u64 *handle; |
@@ -937,7 +936,7 @@ static struct of_device_id ehca_device_table[] = | |||
937 | }; | 936 | }; |
938 | MODULE_DEVICE_TABLE(of, ehca_device_table); | 937 | MODULE_DEVICE_TABLE(of, ehca_device_table); |
939 | 938 | ||
940 | static struct of_platform_driver ehca_driver = { | 939 | static struct platform_driver ehca_driver = { |
941 | .probe = ehca_probe, | 940 | .probe = ehca_probe, |
942 | .remove = ehca_remove, | 941 | .remove = ehca_remove, |
943 | .driver = { | 942 | .driver = { |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 90ea0b1673ca..de2969cae262 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -98,8 +98,7 @@ static struct ehea_fw_handle_array ehea_fw_handles; | |||
98 | static struct ehea_bcmc_reg_array ehea_bcmc_regs; | 98 | static struct ehea_bcmc_reg_array ehea_bcmc_regs; |
99 | 99 | ||
100 | 100 | ||
101 | static int ehea_probe_adapter(struct platform_device *dev, | 101 | static int ehea_probe_adapter(struct platform_device *dev); |
102 | const struct of_device_id *id); | ||
103 | 102 | ||
104 | static int ehea_remove(struct platform_device *dev); | 103 | static int ehea_remove(struct platform_device *dev); |
105 | 104 | ||
@@ -112,7 +111,7 @@ static struct of_device_id ehea_device_table[] = { | |||
112 | }; | 111 | }; |
113 | MODULE_DEVICE_TABLE(of, ehea_device_table); | 112 | MODULE_DEVICE_TABLE(of, ehea_device_table); |
114 | 113 | ||
115 | static struct of_platform_driver ehea_driver = { | 114 | static struct platform_driver ehea_driver = { |
116 | .driver = { | 115 | .driver = { |
117 | .name = "ehea", | 116 | .name = "ehea", |
118 | .owner = THIS_MODULE, | 117 | .owner = THIS_MODULE, |
@@ -3251,8 +3250,7 @@ static void ehea_remove_device_sysfs(struct platform_device *dev) | |||
3251 | device_remove_file(&dev->dev, &dev_attr_remove_port); | 3250 | device_remove_file(&dev->dev, &dev_attr_remove_port); |
3252 | } | 3251 | } |
3253 | 3252 | ||
3254 | static int ehea_probe_adapter(struct platform_device *dev, | 3253 | static int ehea_probe_adapter(struct platform_device *dev) |
3255 | const struct of_device_id *id) | ||
3256 | { | 3254 | { |
3257 | struct ehea_adapter *adapter; | 3255 | struct ehea_adapter *adapter; |
3258 | const u64 *adapter_handle; | 3256 | const u64 *adapter_handle; |