From: Thierry Reding Date: Thu, 29 Nov 2012 03:18:30 +0000 (+1100) Subject: backlight-add-of_find_backlight_by_node-function-fix-2 X-Git-Tag: next-20121205~1^2~166 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=98a2a1cb2e5afbc52692213ebaa82211e28a8a1c;p=karo-tx-linux.git 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 --- 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;