drivers/video/backlight/platform_lcd.c: introduce probe callback

Platform LCD devices may need to do some device-specific initialization
before they can be used (regulator or GPIO setup, for example), but
currently the driver does not support any way of doing this.  This patch
adds a probe() callback to plat_lcd_data which platform LCD devices can
set to indicate that device-specific initialization is needed.

Signed-off-by: Andrew Bresticker <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Reviewed-by: Doug Anderson <[email protected]>
Acked-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Andrew Bresticker 2013-04-29 16:17:58 -07:00 • committed by Linus Torvalds
commit 46e1915eef
2 changed files with 7 additions and 0 deletions

View file

@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev)
return -EINVAL;
}
if (pdata->probe) {
err = pdata->probe(pdata);
if (err)
return err;
}
plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd),
GFP_KERNEL);
if (!plcd) {