All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jingoo Han" <jingoohan1@gmail.com>
To: "'Hyungwon Hwang'" <human.hwang@samsung.com>
Cc: <linux-kernel@vger.kernel.org>, "'Lee Jones'" <lee.jones@linaro.org>
Subject: Re: [PATCH] backlight: change the return type of backlight_update_status() to int
Date: Fri, 29 May 2015 01:25:43 +0900	[thread overview]
Message-ID: <000401d09962$f528f050$df7ad0f0$@com> (raw)
In-Reply-To: <1432797915-27897-1-git-send-email-human.hwang@samsung.com>

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


  reply	other threads:[~2015-05-28 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-05-29  7:05 ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000401d09962$f528f050$df7ad0f0$@com' \
    --to=jingoohan1@gmail.com \
    --cc=human.hwang@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.