From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbbE1QZx (ORCPT ); Thu, 28 May 2015 12:25:53 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33230 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbbE1QZr (ORCPT ); Thu, 28 May 2015 12:25:47 -0400 From: "Jingoo Han" To: "'Hyungwon Hwang'" Cc: , "'Lee Jones'" References: <1432797915-27897-1-git-send-email-human.hwang@samsung.com> In-Reply-To: <1432797915-27897-1-git-send-email-human.hwang@samsung.com> Subject: Re: [PATCH] backlight: change the return type of backlight_update_status() to int Date: Fri, 29 May 2015 01:25:43 +0900 Message-ID: <000401d09962$f528f050$df7ad0f0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdCZF3uO+MEGE8a7RRavIULaWVizvAASyG+w Content-Language: ko Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Jingoo Han > --- > 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