diff options
Diffstat (limited to 'drivers/video/xilinxfb.c')
-rw-r--r-- | drivers/video/xilinxfb.c | 32 |
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 | ||
341 | static int | 341 | static int |
342 | xilinxfb_drv_probe(struct device *dev) | 342 | xilinxfb_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 | ||
372 | static int | 371 | static int |
373 | xilinxfb_drv_remove(struct device *dev) | 372 | xilinxfb_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 | ||
379 | static struct device_driver xilinxfb_driver = { | 378 | static 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 | ||
387 | static int __init | 387 | static 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 | ||
397 | static void __exit | 397 | static void __exit |
398 | xilinxfb_cleanup(void) | 398 | xilinxfb_cleanup(void) |
399 | { | 399 | { |
400 | driver_unregister(&xilinxfb_driver); | 400 | platform_driver_unregister(&xilinxfb_platform_driver); |
401 | } | 401 | } |
402 | 402 | ||
403 | module_init(xilinxfb_init); | 403 | module_init(xilinxfb_init); |