aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/xilinxfb.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-10-04 17:44:52 -0400
committerGrant Likely <grant.likely@secretlab.ca>2007-10-09 20:12:10 -0400
commite3cec00366e9d60ff65c6f6f8fffdfcadea01056 (patch)
tree8b0aa263530bb7483fce30035552ec54fbe43795 /drivers/video/xilinxfb.c
parent31e8d4603ecaeb02424c9669e252ab835354a36e (diff)
[POWERPC] XilinxFB: Make missing pdata structure non-fatal
Missing pdata structure is not a fatal error. The device can still be initialized without it. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
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);