Re: [PATCH v2 21/24] video: da8xx-fb: setup struct lcd_ctrl_config for dt
From: Tomi Valkeinen <hidden>
Date: 2013-07-31 09:33:03
Attachments
- signature.asc [application/pgp-signature] 901 bytes
From: Tomi Valkeinen <hidden>
Date: 2013-07-31 09:33:03
On 30/07/13 21:26, Darren Etheridge wrote:
From: Afzal Mohammed <redacted> strcut lcd_ctrl_config information required for driver is currently obtained via platform data. To handle DT probing, create lcd_ctrl_config and populate it with default values, these values are sufficient for the panels so far used with this controller to work. Signed-off-by: Afzal Mohammed <redacted> Signed-off-by: Darren Etheridge <redacted> --- drivers/video/da8xx-fb.c | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-)diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 697b07c..fe3d79e 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c
<snip>
static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev) { struct da8xx_lcdc_platform_data *fb_pdata = dev->dev.platform_data;@@ -1346,7 +1375,10 @@ static int fb_probe(struct platform_device *device) break; } - lcd_cfg = (struct lcd_ctrl_config *)fb_pdata->controller_data;
In the previous patch you allow fb_pdata==NULL if booting with DT. However, this patch shows that fb_pdata is still accessed. So I think you need to move the previous patch after this to avoid a crash between this and the previous patch.
+ if (device->dev.of_node) + lcd_cfg = da8xx_fb_create_cfg(device); + else + lcd_cfg = (struct lcd_ctrl_config *)fb_pdata->controller_data;
fb_pdata->controller_data is void *, so you don't need to cast it explicitly. Tomi