From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755493AbbE2HFN (ORCPT ); Fri, 29 May 2015 03:05:13 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:35297 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752189AbbE2HFG (ORCPT ); Fri, 29 May 2015 03:05:06 -0400 Date: Fri, 29 May 2015 08:05:01 +0100 From: Lee Jones To: Hyungwon Hwang Cc: linux-kernel@vger.kernel.org, jingoohan1@gmail.com Subject: Re: [PATCH] backlight: change the return type of backlight_update_status() to int Message-ID: <20150529070501.GV11677@x1> References: <1432797915-27897-1-git-send-email-human.hwang@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1432797915-27897-1-git-send-email-human.hwang@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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