Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751333AbeAPQuW (ORCPT + 1 other); Tue, 16 Jan 2018 11:50:22 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:44328 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbeAPQuS (ORCPT ); Tue, 16 Jan 2018 11:50:18 -0500 Subject: Re: [PATCH v16 01/10] video: backlight: Add helpers to enable and disable backlight To: Meghana Madhyastha , Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: <83bd70d2-ad59-c6e4-fa3c-df89361bb206@tronnes.org> Date: Tue, 16 Jan 2018 17:50:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Den 16.01.2018 11.31, skrev Meghana Madhyastha: > Add helper functions backlight_enable and backlight_disable to > enable/disable a backlight device. These helper functions can > then be used by different drm and tinydrm drivers to avoid > repetition of code and also to enforce a uniform and consistent > way to enable/disable a backlight device. > > Signed-off-by: Meghana Madhyastha checkpatch complains: -:23: WARNING: Block comments should align the * on each line -:45: ERROR: trailing whitespace With that fixed: Reviewed-by: Noralf Trønnes > --- > include/linux/backlight.h | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/include/linux/backlight.h b/include/linux/backlight.h > index af7003548..7b6a9a2a3 100644 > --- a/include/linux/backlight.h > +++ b/include/linux/backlight.h > @@ -130,6 +130,36 @@ static inline int backlight_update_status(struct backlight_device *bd) > return ret; > } > > +/** > + * backlight_enable - Enable backlight > + * @bd: the backlight device to enable > + */ > +static inline int backlight_enable(struct backlight_device *bd) > +{ > + if (!bd) > + return 0; > + > + bd->props.power = FB_BLANK_UNBLANK; > + bd->props.state &= ~BL_CORE_FBBLANK; > + > + return backlight_update_status(bd); > +} > + > +/** > + * backlight_disable - Disable backlight > + * @bd: the backlight device to disable > + */ > +static inline int backlight_disable(struct backlight_device *bd) > +{ > + if (!bd) > + return 0; > + > + bd->props.power = FB_BLANK_POWERDOWN; > + bd->props.state |= BL_CORE_FBBLANK; > + > + return backlight_update_status(bd); > +} > + > extern struct backlight_device *backlight_device_register(const char *name, > struct device *dev, void *devdata, const struct backlight_ops *ops, > const struct backlight_properties *props);