提交 cca0ba2d 编写于 作者: H Hyungwon Hwang 提交者: Lee Jones

backlight: Change the return type of backlight_update_status() to int

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: NHyungwon Hwang <human.hwang@samsung.com>
Acked-by: NJingoo Han <jingoohan1@gmail.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 cdaefcce
...@@ -117,12 +117,16 @@ struct backlight_device { ...@@ -117,12 +117,16 @@ struct backlight_device {
int use_count; 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); mutex_lock(&bd->update_lock);
if (bd->ops && bd->ops->update_status) if (bd->ops && bd->ops->update_status)
bd->ops->update_status(bd); ret = bd->ops->update_status(bd);
mutex_unlock(&bd->update_lock); mutex_unlock(&bd->update_lock);
return ret;
} }
extern struct backlight_device *backlight_device_register(const char *name, extern struct backlight_device *backlight_device_register(const char *name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册