summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-10-04 15:44:52 -0600
committerGrant Likely <grant.likely@secretlab.ca>2007-10-09 18:12:10 -0600
commite3cec00366e9d60ff65c6f6f8fffdfcadea01056 (patch)
tree8b0aa263530bb7483fce30035552ec54fbe43795 /drivers
parent31e8d4603ecaeb02424c9669e252ab835354a36e (diff)
downloadop-kernel-dev-e3cec00366e9d60ff65c6f6f8fffdfcadea01056.zip
op-kernel-dev-e3cec00366e9d60ff65c6f6f8fffdfcadea01056.tar.gz
[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')
-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 dbb23a9..e6e12be 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -349,15 +349,9 @@ xilinxfb_platform_probe(struct platform_device *pdev)
{
struct xilinxfb_platform_data *pdata;
struct resource *res;
- int width_mm;
- int height_mm;
- int rotate;
-
- pdata = pdev->dev.platform_data;
- if (!pdata) {
- dev_err(&pdev->dev, "Missing pdata structure\n");
- return -ENODEV;
- }
+ int width_mm = 0;
+ int height_mm = 0;
+ int rotate = 0;
/* Find the registers address */
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -366,9 +360,13 @@ xilinxfb_platform_probe(struct platform_device *pdev)
return -ENODEV;
}
- height_mm = pdata->screen_height_mm;
- width_mm = pdata->screen_width_mm;
- rotate = pdata->rotate_screen ? 1 : 0;
+ /* If a pdata structure is provided, then extract the parameters */
+ pdata = pdev->dev.platform_data;
+ if (pdata) {
+ height_mm = pdata->screen_height_mm;
+ width_mm = pdata->screen_width_mm;
+ rotate = pdata->rotate_screen ? 1 : 0;
+ }
return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
rotate);
OpenPOWER on IntegriCloud