aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/xilinxfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/xilinxfb.c')
-rw-r--r--drivers/video/xilinxfb.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index dbb23a9fef7b..e6e12be845a9 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -349,15 +349,9 @@ xilinxfb_platform_probe(struct platform_device *pdev)
349{ 349{
350 struct xilinxfb_platform_data *pdata; 350 struct xilinxfb_platform_data *pdata;
351 struct resource *res; 351 struct resource *res;
352 int width_mm; 352 int width_mm = 0;
353 int height_mm; 353 int height_mm = 0;
354 int rotate; 354 int rotate = 0;
355
356 pdata = pdev->dev.platform_data;
357 if (!pdata) {
358 dev_err(&pdev->dev, "Missing pdata structure\n");
359 return -ENODEV;
360 }
361 355
362 /* Find the registers address */ 356 /* Find the registers address */
363 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 357 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -366,9 +360,13 @@ xilinxfb_platform_probe(struct platform_device *pdev)
366 return -ENODEV; 360 return -ENODEV;
367 } 361 }
368 362
369 height_mm = pdata->screen_height_mm; 363 /* If a pdata structure is provided, then extract the parameters */
370 width_mm = pdata->screen_width_mm; 364 pdata = pdev->dev.platform_data;
371 rotate = pdata->rotate_screen ? 1 : 0; 365 if (pdata) {
366 height_mm = pdata->screen_height_mm;
367 width_mm = pdata->screen_width_mm;
368 rotate = pdata->rotate_screen ? 1 : 0;
369 }
372 370
373 return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm, 371 return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
374 rotate); 372 rotate);