From 98a2a1cb2e5afbc52692213ebaa82211e28a8a1c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 29 Nov 2012 14:18:30 +1100 Subject: [PATCH] backlight-add-of_find_backlight_by_node-function-fix-2 Signed-off-by: Thierry Reding Reviewed-by: Grant Likely Acked-by: Jingoo Han Signed-off-by: Andrew Morton --- drivers/video/backlight/backlight.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index f41ce15f2fbb..345f6660d4b3 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -376,6 +376,18 @@ static int of_parent_match(struct device *dev, void *data) return dev->parent && dev->parent->of_node == data; } +/** + * of_find_backlight_by_node() - find backlight device by device-tree node + * @node: device-tree node of the backlight device + * + * Returns a pointer to the backlight device corresponding to the given DT + * node or NULL if no such backlight device exists or if the device hasn't + * been probed yet. + * + * This function obtains a reference on the backlight device and it is the + * caller's responsibility to drop the reference by calling put_device() on + * the backlight device's .dev field. + */ struct backlight_device *of_find_backlight_by_node(struct device_node *node) { struct device *dev; -- 2.39.5