Commit e3cec003 authored by Grant Likely's avatar Grant Likely

[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: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 31e8d460
...@@ -349,15 +349,9 @@ xilinxfb_platform_probe(struct platform_device *pdev) ...@@ -349,15 +349,9 @@ xilinxfb_platform_probe(struct platform_device *pdev)
{ {
struct xilinxfb_platform_data *pdata; struct xilinxfb_platform_data *pdata;
struct resource *res; struct resource *res;
int width_mm; int width_mm = 0;
int height_mm; int height_mm = 0;
int rotate; int rotate = 0;
pdata = pdev->dev.platform_data;
if (!pdata) {
dev_err(&pdev->dev, "Missing pdata structure\n");
return -ENODEV;
}
/* Find the registers address */ /* Find the registers address */
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_IO, 0);
...@@ -366,9 +360,13 @@ xilinxfb_platform_probe(struct platform_device *pdev) ...@@ -366,9 +360,13 @@ xilinxfb_platform_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
/* If a pdata structure is provided, then extract the parameters */
pdata = pdev->dev.platform_data;
if (pdata) {
height_mm = pdata->screen_height_mm; height_mm = pdata->screen_height_mm;
width_mm = pdata->screen_width_mm; width_mm = pdata->screen_width_mm;
rotate = pdata->rotate_screen ? 1 : 0; rotate = pdata->rotate_screen ? 1 : 0;
}
return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm, return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
rotate); rotate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment