aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/backlight.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/backlight.h')
-rw-r--r--include/linux/backlight.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index ace825e2ca2d..ddc9bade4fb2 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -162,6 +162,16 @@ static inline int backlight_disable(struct backlight_device *bd)
162 return backlight_update_status(bd); 162 return backlight_update_status(bd);
163} 163}
164 164
165/**
166 * backlight_put - Drop backlight reference
167 * @bd: the backlight device to put
168 */
169static inline void backlight_put(struct backlight_device *bd)
170{
171 if (bd)
172 put_device(&bd->dev);
173}
174
165extern struct backlight_device *backlight_device_register(const char *name, 175extern struct backlight_device *backlight_device_register(const char *name,
166 struct device *dev, void *devdata, const struct backlight_ops *ops, 176 struct device *dev, void *devdata, const struct backlight_ops *ops,
167 const struct backlight_properties *props); 177 const struct backlight_properties *props);
@@ -205,4 +215,13 @@ of_find_backlight_by_node(struct device_node *node)
205} 215}
206#endif 216#endif
207 217
218#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
219struct backlight_device *of_find_backlight(struct device *dev);
220#else
221static inline struct backlight_device *of_find_backlight(struct device *dev)
222{
223 return NULL;
224}
225#endif
226
208#endif 227#endif