aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/xilinxfb.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 44ce955a5b14..6ef9733a18d4 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -212,11 +212,6 @@ xilinxfb_drv_probe(struct device *dev)
212 pdev = to_platform_device(dev); 212 pdev = to_platform_device(dev);
213 pdata = pdev->dev.platform_data; 213 pdata = pdev->dev.platform_data;
214 214
215 if (pdata == NULL) {
216 printk(KERN_ERR "Couldn't find platform data.\n");
217 return -EFAULT;
218 }
219
220 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); 215 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
221 if (!drvdata) { 216 if (!drvdata) {
222 printk(KERN_ERR "Couldn't allocate device private record\n"); 217 printk(KERN_ERR "Couldn't allocate device private record\n");
@@ -258,11 +253,9 @@ xilinxfb_drv_probe(struct device *dev)
258 xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys); 253 xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
259 254
260 /* Turn on the display */ 255 /* Turn on the display */
261 if (pdata->rotate_screen) { 256 drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
262 drvdata->reg_ctrl_default = REG_CTRL_ENABLE | REG_CTRL_ROTATE; 257 if (pdata && pdata->rotate_screen)
263 } else { 258 drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
264 drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
265 }
266 xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); 259 xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
267 260
268 /* Fill struct fb_info */ 261 /* Fill struct fb_info */
@@ -281,8 +274,10 @@ xilinxfb_drv_probe(struct device *dev)
281 } 274 }
282 275
283 drvdata->info.flags = FBINFO_DEFAULT; 276 drvdata->info.flags = FBINFO_DEFAULT;
284 xilinx_fb_var.height = pdata->screen_height_mm; 277 if (pdata) {
285 xilinx_fb_var.width = pdata->screen_width_mm; 278 xilinx_fb_var.height = pdata->screen_height_mm;
279 xilinx_fb_var.width = pdata->screen_width_mm;
280 }
286 drvdata->info.var = xilinx_fb_var; 281 drvdata->info.var = xilinx_fb_var;
287 282
288 /* Register new frame buffer */ 283 /* Register new frame buffer */