* [PATCH] backlight: change the return type of backlight_update_status() to int
@ 2015-05-28 7:25 Hyungwon Hwang
2015-05-28 16:25 ` Jingoo Han
2015-05-29 7:05 ` Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Hyungwon Hwang @ 2015-05-28 7:25 UTC (permalink / raw)
To: linux-kernel, jingoohan1, lee.jones; +Cc: Hyungwon Hwang
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>
---
include/linux/backlight.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index adb14a8..1e7a69a 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -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,
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] backlight: change the return type of backlight_update_status() to int
2015-05-28 7:25 [PATCH] backlight: change the return type of backlight_update_status() to int Hyungwon Hwang
@ 2015-05-28 16:25 ` Jingoo Han
2015-05-29 7:05 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2015-05-28 16:25 UTC (permalink / raw)
To: 'Hyungwon Hwang'; +Cc: linux-kernel, 'Lee Jones'
On Thursday, May 28, 2015 4:25 PM, Hyungwon Hwang wrote:
>
> 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>
> ---
> include/linux/backlight.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
> index adb14a8..1e7a69a 100644
> --- a/include/linux/backlight.h
> +++ b/include/linux/backlight.h
> @@ -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,
> --
> 1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] backlight: change the return type of backlight_update_status() to int
2015-05-28 7:25 [PATCH] backlight: change the return type of backlight_update_status() to int Hyungwon Hwang
2015-05-28 16:25 ` Jingoo Han
@ 2015-05-29 7:05 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2015-05-29 7:05 UTC (permalink / raw)
To: Hyungwon Hwang; +Cc: linux-kernel, jingoohan1
On Thu, 28 May 2015, Hyungwon Hwang wrote:
> 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>
> ---
> include/linux/backlight.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Applied with Jingoo's Ack, thanks.
> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
> index adb14a8..1e7a69a 100644
> --- a/include/linux/backlight.h
> +++ b/include/linux/backlight.h
> @@ -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,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-29 7:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28 7:25 [PATCH] backlight: change the return type of backlight_update_status() to int Hyungwon Hwang
2015-05-28 16:25 ` Jingoo Han
2015-05-29 7:05 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).