backlight: Change the return type of backlight_update_status() to int
authorHyungwon Hwang <human.hwang@samsung.com>
Thu, 28 May 2015 07:25:15 +0000 (16:25 +0900)
committerLee Jones <lee.jones@linaro.org>
Tue, 23 Jun 2015 14:47:35 +0000 (15:47 +0100)
Backlight device returns the result of update_status(), but
backlight_update_status() ignores it. So the consumers cannot confirm the
result of their function call. This patch makes the result to be returned
back for consumers.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
include/linux/backlight.h

index adb14a8616df53e681031e895ff37e783ca287f7..1e7a69adbe6f6992fa955e1c907d0820a224d177 100644 (file)
@@ -117,12 +117,16 @@ struct backlight_device {
        int use_count;
 };
 
-static inline void backlight_update_status(struct backlight_device *bd)
+static inline int backlight_update_status(struct backlight_device *bd)
 {
+       int ret = -ENOENT;
+
        mutex_lock(&bd->update_lock);
        if (bd->ops && bd->ops->update_status)
-               bd->ops->update_status(bd);
+               ret = bd->ops->update_status(bd);
        mutex_unlock(&bd->update_lock);
+
+       return ret;
 }
 
 extern struct backlight_device *backlight_device_register(const char *name,