diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2012-12-17 19:01:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:16 -0500 |
commit | 762a936fba7bd9225ca9a96e4860f6969b6b5670 (patch) | |
tree | afb3f60c95eb8d21573e80683c61bb43ebb58ffe /include/linux/backlight.h | |
parent | fb08cd9b111c6a922f468ef5e33acc67eb91d40b (diff) |
backlight: add of_find_backlight_by_node()
This function finds the struct backlight_device for a given device tree
node. A dummy function is provided so that it safely compiles out if OF
support is disabled.
[akpm@linux-foundation.org: Don't use IS_ENABLED(CONFIG_OF)]
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/backlight.h')
-rw-r--r-- | include/linux/backlight.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 5ffc6dda4675..da9a0825e007 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -134,4 +134,14 @@ struct generic_bl_info { | |||
134 | void (*kick_battery)(void); | 134 | void (*kick_battery)(void); |
135 | }; | 135 | }; |
136 | 136 | ||
137 | #ifdef CONFIG_OF | ||
138 | struct backlight_device *of_find_backlight_by_node(struct device_node *node); | ||
139 | #else | ||
140 | static inline struct backlight_device * | ||
141 | of_find_backlight_by_node(struct device_node *node) | ||
142 | { | ||
143 | return NULL; | ||
144 | } | ||
145 | #endif | ||
146 | |||
137 | #endif | 147 | #endif |