aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-10-04 12:48:37 -0400
committerGrant Likely <grant.likely@secretlab.ca>2007-10-09 20:11:50 -0400
commit47473e31585032e5c048eeec50e0f9165890230a (patch)
treee15df51c51e2291cf06b9cc9076b595359261b8e
parent264776224d3bb0cd80bc0ec11a769e05a58f8c6b (diff)
[POWERPC] XilinxFB: cleanup platform_bus binding to use platform bus API.
Change the platform bus binding to make use of the established platform_bus API. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Andrei Konovalov <akonovalov@ru.mvista.com>
-rw-r--r--drivers/video/xilinxfb.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 12d91279996d..e482bb519635 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -339,26 +339,24 @@ static int xilinxfb_release(struct device *dev)
339 */ 339 */
340 340
341static int 341static int
342xilinxfb_drv_probe(struct device *dev) 342xilinxfb_platform_probe(struct platform_device *pdev)
343{ 343{
344 struct platform_device *pdev;
345 struct xilinxfb_platform_data *pdata; 344 struct xilinxfb_platform_data *pdata;
346 struct resource *res; 345 struct resource *res;
347 int width_mm; 346 int width_mm;
348 int height_mm; 347 int height_mm;
349 int rotate; 348 int rotate;
350 349
351 pdev = to_platform_device(dev);
352 pdata = pdev->dev.platform_data; 350 pdata = pdev->dev.platform_data;
353 if (!pdata) { 351 if (!pdata) {
354 dev_err(dev, "Missing pdata structure\n"); 352 dev_err(&pdev->dev, "Missing pdata structure\n");
355 return -ENODEV; 353 return -ENODEV;
356 } 354 }
357 355
358 /* Find the registers address */ 356 /* Find the registers address */
359 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 357 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
360 if (!res) { 358 if (!res) {
361 dev_err(dev, "Couldn't get registers resource\n"); 359 dev_err(&pdev->dev, "Couldn't get registers resource\n");
362 return -ENODEV; 360 return -ENODEV;
363 } 361 }
364 362
@@ -366,22 +364,24 @@ xilinxfb_drv_probe(struct device *dev)
366 width_mm = pdata->screen_width_mm; 364 width_mm = pdata->screen_width_mm;
367 rotate = pdata->rotate_screen ? 1 : 0; 365 rotate = pdata->rotate_screen ? 1 : 0;
368 366
369 return xilinxfb_assign(dev, res->start, width_mm, height_mm, rotate); 367 return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
368 rotate);
370} 369}
371 370
372static int 371static int
373xilinxfb_drv_remove(struct device *dev) 372xilinxfb_platform_remove(struct platform_device *pdev)
374{ 373{
375 return xilinxfb_release(dev); 374 return xilinxfb_release(&pdev->dev);
376} 375}
377 376
378 377
379static struct device_driver xilinxfb_driver = { 378static struct platform_driver xilinxfb_platform_driver = {
380 .name = DRIVER_NAME, 379 .probe = xilinxfb_platform_probe,
381 .bus = &platform_bus_type, 380 .remove = xilinxfb_platform_remove,
382 381 .driver = {
383 .probe = xilinxfb_drv_probe, 382 .owner = THIS_MODULE,
384 .remove = xilinxfb_drv_remove 383 .name = DRIVER_NAME,
384 },
385}; 385};
386 386
387static int __init 387static int __init
@@ -391,13 +391,13 @@ xilinxfb_init(void)
391 * No kernel boot options used, 391 * No kernel boot options used,
392 * so we just need to register the driver 392 * so we just need to register the driver
393 */ 393 */
394 return driver_register(&xilinxfb_driver); 394 return platform_driver_register(&xilinxfb_platform_driver);
395} 395}
396 396
397static void __exit 397static void __exit
398xilinxfb_cleanup(void) 398xilinxfb_cleanup(void)
399{ 399{
400 driver_unregister(&xilinxfb_driver); 400 platform_driver_unregister(&xilinxfb_platform_driver);
401} 401}
402 402
403module_init(xilinxfb_init); 403module_init(xilinxfb_init);