diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2007-07-31 09:37:39 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-01 00:39:37 +0200 |
commit | f53161d1088567dda41094a932f6a16dc0bdae59 (patch) | |
tree | b2201b1490ef19362fc49b9c798fab02db317fae /drivers/video/xilinxfb.c | |
parent | xilinxfb:Remove __initdata from xilinx_fb_fix and xilinx_fb_var (diff) | |
download | linux-f53161d1088567dda41094a932f6a16dc0bdae59.tar.xz linux-f53161d1088567dda41094a932f6a16dc0bdae59.zip |
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: Grant Likely <grant.likely@secretlab.ca>
Cc: Andrei Konovalov <akonovalov@ru.mvista.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/video/xilinxfb.c | 19 |
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) pdev = to_platform_device(dev); 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); if (!drvdata) { printk(KERN_ERR "Couldn't allocate device private record\n"); @@ -258,11 +253,9 @@ xilinxfb_drv_probe(struct device *dev) xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys); /* Turn on the display */ - if (pdata->rotate_screen) { - drvdata->reg_ctrl_default = REG_CTRL_ENABLE | REG_CTRL_ROTATE; - } else { - drvdata->reg_ctrl_default = REG_CTRL_ENABLE; - } + drvdata->reg_ctrl_default = REG_CTRL_ENABLE; + if (pdata && pdata->rotate_screen) + drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); /* Fill struct fb_info */ @@ -281,8 +274,10 @@ xilinxfb_drv_probe(struct device *dev) } drvdata->info.flags = FBINFO_DEFAULT; - xilinx_fb_var.height = pdata->screen_height_mm; - xilinx_fb_var.width = pdata->screen_width_mm; + if (pdata) { + xilinx_fb_var.height = pdata->screen_height_mm; + xilinx_fb_var.width = pdata->screen_width_mm; + } drvdata->info.var = xilinx_fb_var; /* Register new frame buffer */ |