Commit f53161d1 authored by Grant Likely's avatar Grant Likely Committed by Linus Torvalds

xilinxfb: Don't bail if the xilinxfb platform device doesn't have any pdata

Lack of pdata is not a fatal omission.  The driver can still be used even
if we do not know the screen dimensions.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Cc: Andrei Konovalov <akonovalov@ru.mvista.com>
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3f5b85d1
...@@ -212,11 +212,6 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -212,11 +212,6 @@ xilinxfb_drv_probe(struct device *dev)
pdev = to_platform_device(dev); pdev = to_platform_device(dev);
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
if (pdata == NULL) {
printk(KERN_ERR "Couldn't find platform data.\n");
return -EFAULT;
}
drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
if (!drvdata) { if (!drvdata) {
printk(KERN_ERR "Couldn't allocate device private record\n"); printk(KERN_ERR "Couldn't allocate device private record\n");
...@@ -258,11 +253,9 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -258,11 +253,9 @@ xilinxfb_drv_probe(struct device *dev)
xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys); xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
/* Turn on the display */ /* Turn on the display */
if (pdata->rotate_screen) { drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
drvdata->reg_ctrl_default = REG_CTRL_ENABLE | REG_CTRL_ROTATE; if (pdata && pdata->rotate_screen)
} else { drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
}
xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
/* Fill struct fb_info */ /* Fill struct fb_info */
...@@ -281,8 +274,10 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -281,8 +274,10 @@ xilinxfb_drv_probe(struct device *dev)
} }
drvdata->info.flags = FBINFO_DEFAULT; drvdata->info.flags = FBINFO_DEFAULT;
xilinx_fb_var.height = pdata->screen_height_mm; if (pdata) {
xilinx_fb_var.width = pdata->screen_width_mm; xilinx_fb_var.height = pdata->screen_height_mm;
xilinx_fb_var.width = pdata->screen_width_mm;
}
drvdata->info.var = xilinx_fb_var; drvdata->info.var = xilinx_fb_var;
/* Register new frame buffer */ /* Register new frame buffer */
......
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