Skip to content

Commit 52e8424

Browse files
Jingoo Hantorvalds
Jingoo Han
authored andcommittedOct 5, 2012
drivers/video/backlight/platform_lcd.c: add support for device tree based probe
This patch adds the of_match_table to platform-lcd driver to be probed when platform-lcd device node is found in the device tree. [[email protected]: include of.h] Signed-off-by: Jingoo Han <[email protected]> Cc: Richard Purdie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 66be0e5 commit 52e8424

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

Diff for: ‎drivers/video/backlight/platform_lcd.c

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/fb.h>
1717
#include <linux/backlight.h>
1818
#include <linux/lcd.h>
19+
#include <linux/of.h>
1920
#include <linux/slab.h>
2021

2122
#include <video/platform_lcd.h>
@@ -145,13 +146,22 @@ static SIMPLE_DEV_PM_OPS(platform_lcd_pm_ops, platform_lcd_suspend,
145146
platform_lcd_resume);
146147
#endif
147148

149+
#ifdef CONFIG_OF
150+
static const struct of_device_id platform_lcd_of_match[] = {
151+
{ .compatible = "platform-lcd" },
152+
{},
153+
};
154+
MODULE_DEVICE_TABLE(of, platform_lcd_of_match);
155+
#endif
156+
148157
static struct platform_driver platform_lcd_driver = {
149158
.driver = {
150159
.name = "platform-lcd",
151160
.owner = THIS_MODULE,
152161
#ifdef CONFIG_PM
153162
.pm = &platform_lcd_pm_ops,
154163
#endif
164+
.of_match_table = of_match_ptr(platform_lcd_of_match),
155165
},
156166
.probe = platform_lcd_probe,
157167
.remove = __devexit_p(platform_lcd_remove),

0 commit comments

Comments
 (0)