Message ID | 20230106164856.1453819-5-steve@sk2.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp938453wrt; Fri, 6 Jan 2023 09:30:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXvoQN6IcBuGo0AdSAxMSSDrDCtnIUOTnxXtNLOyMAkJFfmfTZyEr2oveXbCmMZRamMROgKa X-Received: by 2002:a05:6a20:c196:b0:b2:36a6:d7b4 with SMTP id bg22-20020a056a20c19600b000b236a6d7b4mr71275035pzb.27.1673026224629; Fri, 06 Jan 2023 09:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673026224; cv=none; d=google.com; s=arc-20160816; b=W+h0qG4u7v3nq+XAyGMqJlko/ule/Xuf/9/mNYM7OYn7btZUebmAeQqwbON5vdkwQK hAljYLKEyxvMaPkbOCXrMqaD2P5cUG/tpgX/rTPK8yFP7w7tgD8IaItnqunqgHlYoBWA FjhkCZYZ4lZSHYVVdgoJgAoALSL9a1GiOWnLePnZY9hnJLN21sP6FCeNnHg5QQWuYe55 eYJCAGU0y0ArktBxxKW42wH5nXcSbeS9iPNzvIz4+vIwZvaVDvkO9c+zkxBAo5Id5MTW 7xLdSL5FhDr4148y/wfv7tkf2DqD0REVTZoIwdAi4/Be7MT7Cejuuo7cSwxleJ9QrHKz BqLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NYvEY5oPZriG4aXFzU5eiHpboLMN63j/WjdfYJARggo=; b=MvYg+NbmOMdY7ktYxY/rEW+4HneG6G6KcN60ayq/8pW63pCOVK0crQ2HD0JnRHHkY6 zghxHPHm1rCZ2UIHn2lyP+3ohh/8VdTNiEe2BdG+uwLCqDm196AbFspSlGdybp2R23+z 7jNTVrr0tNyxgUmsrJm6q9XrjY52WsNwB+SKulGGgJz4QUa7vojn1igMrybSgKA+Z96m MERBZjt4C7fKjwGyD2rVSrmIwBev7g2wuLtkG3SAcFdpPndnHYL9nrhbuS5DWRidpNQQ zNeOaFNpp4FX8wQMXI3j6FT+SVAbkVT5FaHrKOTJeUGsW3+d/fcwn9QQla4clBk+7JWK c/4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j20-20020a635514000000b0049694f10986si1868683pgb.697.2023.01.06.09.30.11; Fri, 06 Jan 2023 09:30:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231307AbjAFR1f (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Fri, 6 Jan 2023 12:27:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjAFR1d (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 12:27:33 -0500 X-Greylist: delayed 1201 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 06 Jan 2023 09:27:30 PST Received: from 6.mo582.mail-out.ovh.net (6.mo582.mail-out.ovh.net [87.98.177.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613047D9D5 for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 09:27:30 -0800 (PST) Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.143.24]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id EF2F326240 for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 16:50:01 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-dkv5l (unknown [10.110.171.46]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 34F0B1FE9B; Fri, 6 Jan 2023 16:50:01 +0000 (UTC) Received: from sk2.org ([37.59.142.107]) by ghost-submission-6684bf9d7b-dkv5l with ESMTPSA id 4GNNCjlRuGOnAQEAwhnnFg (envelope-from <steve@sk2.org>); Fri, 06 Jan 2023 16:50:01 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S00126819975-9ec8-4c29-9bdd-5acdba6470ab, 9FE29456621203A27B372E1E0503D45BE0167874) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt <steve@sk2.org> To: Lee Jones <lee@kernel.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org>, Stephen Kitt <steve@sk2.org>, Helge Deller <deller@gmx.de>, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 4/4] backlight: tosa: Use backlight helper Date: Fri, 6 Jan 2023 17:48:55 +0100 Message-Id: <20230106164856.1453819-5-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 5852709192662877915 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrkedtgdelgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehsthgvvhgvsehskhdvrdhorhhgqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754295146009728822?= X-GMAIL-MSGID: =?utf-8?q?1754295146009728822?= |
Series |
[RESEND,1/4] backlight: aat2870: Use backlight helper
|
|
Commit Message
Stephen Kitt
Jan. 6, 2023, 4:48 p.m. UTC
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 <steve@sk2.org>
---
drivers/video/backlight/tosa_bl.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
Comments
On Fri, Jan 06, 2023 at 05:48:55PM +0100, Stephen Kitt wrote: > 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 <steve@sk2.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> > --- > drivers/video/backlight/tosa_bl.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c > index 77b71f6c19b5..e338b1f00f6a 100644 > --- a/drivers/video/backlight/tosa_bl.c > +++ b/drivers/video/backlight/tosa_bl.c > @@ -50,13 +50,8 @@ static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness) > > static int tosa_bl_update_status(struct backlight_device *dev) > { > - struct backlight_properties *props = &dev->props; > struct tosa_bl_data *data = bl_get_data(dev); > - int power = max(props->power, props->fb_blank); > - int brightness = props->brightness; > - > - if (power) > - brightness = 0; > + int brightness = backlight_get_brightness(dev); > > tosa_bl_set_backlight(data, brightness); > > -- > 2.30.2
On Fri, Jan 06, 2023 at 05:48:55PM +0100, Stephen Kitt wrote: > 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 <steve@sk2.org> I just realized... This driver is about to be deleted by Arnd's effort to remove the PXA platform, so the patch is not relevant and can be ignored. See https://lore.kernel.org/dri-devel/20221019161831.3864786-1-arnd@kernel.org/ Sam > --- > drivers/video/backlight/tosa_bl.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c > index 77b71f6c19b5..e338b1f00f6a 100644 > --- a/drivers/video/backlight/tosa_bl.c > +++ b/drivers/video/backlight/tosa_bl.c > @@ -50,13 +50,8 @@ static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness) > > static int tosa_bl_update_status(struct backlight_device *dev) > { > - struct backlight_properties *props = &dev->props; > struct tosa_bl_data *data = bl_get_data(dev); > - int power = max(props->power, props->fb_blank); > - int brightness = props->brightness; > - > - if (power) > - brightness = 0; > + int brightness = backlight_get_brightness(dev); > > tosa_bl_set_backlight(data, brightness); > > -- > 2.30.2
On Fri, Jan 06, 2023 at 05:48:55PM +0100, Stephen Kitt wrote: > 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 <steve@sk2.org> For the tools: Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> D.
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 77b71f6c19b5..e338b1f00f6a 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c @@ -50,13 +50,8 @@ static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness) static int tosa_bl_update_status(struct backlight_device *dev) { - struct backlight_properties *props = &dev->props; struct tosa_bl_data *data = bl_get_data(dev); - int power = max(props->power, props->fb_blank); - int brightness = props->brightness; - - if (power) - brightness = 0; + int brightness = backlight_get_brightness(dev); tosa_bl_set_backlight(data, brightness);