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 /arch | |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/ibmebus.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 22 |
2 files changed, 12 insertions, 14 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) |