aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/ibmebus.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/ibmebus.c')
-rw-r--r--arch/powerpc/kernel/ibmebus.c22
1 files changed, 10 insertions, 12 deletions
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
208int ibmebus_register_driver(struct of_platform_driver *drv) 208int 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}
216EXPORT_SYMBOL(ibmebus_register_driver); 216EXPORT_SYMBOL(ibmebus_register_driver);
217 217
218void ibmebus_unregister_driver(struct of_platform_driver *drv) 218void 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)
338static int ibmebus_bus_device_probe(struct device *dev) 338static 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)
362static int ibmebus_bus_device_remove(struct device *dev) 360static 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)
372static void ibmebus_bus_device_shutdown(struct device *dev) 370static 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[] = {
419static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) 417static 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)
430static int ibmebus_bus_legacy_resume(struct device *dev) 428static 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)