From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C1B8C433EF for ; Tue, 21 Jun 2022 06:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345622AbiFUGUm (ORCPT ); Tue, 21 Jun 2022 02:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236786AbiFUGUk (ORCPT ); Tue, 21 Jun 2022 02:20:40 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE2E5FB9; Mon, 20 Jun 2022 23:20:39 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 59295104; Tue, 21 Jun 2022 08:20:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655792437; bh=QxqGI8u7Mcjy3hAKsyC9Lq9xMXJUcfr/8cXBFAGKrXQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Um0skpAxHmGTSW5KKa9z6qFSD447639lNm8xsuDGUtCDvnxWVWxm4oydnlFJ9PVwb 0tOOgMIePz4s/oh+Lo48RnSPA9Qz2j/6XjVucwtIBS/vnloeur3715E9IPgyvg72fP P0BZRSU9B5A4FAHOP5VlpBrO2tj5O7FBOl7Ks6co= Date: Tue, 21 Jun 2022 09:20:21 +0300 From: Laurent Pinchart To: Stephen Kitt Cc: Kieran Bingham , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drm: shmobile: Use backlight helper Message-ID: References: <20220616170821.1348169-1-steve@sk2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220616170821.1348169-1-steve@sk2.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, Thank you for the patch. On Thu, Jun 16, 2022 at 07:08:21PM +0200, Stephen Kitt wrote: > This started with work on the removal of backlight_properties' > deprecated fb_blank field, much of which can be taken care of by using > helper functions provided by backlight.h instead of directly accessing > fields in backlight_properties. This patch series doesn't involve > fb_blank, but it still seems useful to use helper functions where > appropriate. > > Instead of retrieving the backlight brightness in struct > backlight_properties manually, and then checking whether the backlight > should be on at all, use backlight_get_brightness() which does all > this and insulates this from future changes. > > Signed-off-by: Stephen Kitt > Cc: Laurent Pinchart > Cc: Kieran Bingham > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart > --- > Changes since v1: clarified commit message, this doesn't touch fb_blank > --- > drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c > index f6628a5ee95f..794573badfe8 100644 > --- a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c > +++ b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c > @@ -18,11 +18,7 @@ static int shmob_drm_backlight_update(struct backlight_device *bdev) > struct shmob_drm_connector *scon = bl_get_data(bdev); > struct shmob_drm_device *sdev = scon->connector.dev->dev_private; > const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; > - int brightness = bdev->props.brightness; > - > - if (bdev->props.power != FB_BLANK_UNBLANK || > - bdev->props.state & BL_CORE_SUSPENDED) > - brightness = 0; > + int brightness = backlight_get_brightness(bdev); > > return bdata->set_brightness(brightness); > } > > base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 -- Regards, Laurent Pinchart