Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4071437rwl; Sat, 7 Jan 2023 10:29:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvYorhFDDwi9L4b0jFIwe7GQjApvUQEKwb4uYfwxwZoGXyMua20iZmBv5b5Fx0p9HipXexD X-Received: by 2002:a17:90a:db8a:b0:226:632c:abbd with SMTP id h10-20020a17090adb8a00b00226632cabbdmr23662885pjv.47.1673116159449; Sat, 07 Jan 2023 10:29:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116159; cv=none; d=google.com; s=arc-20160816; b=KYmCSkqtV3YaT7Y9vdB4lCPQJd72sVTqWv0E9uRWlGeuJWaZEAgifzanDlvC+Y+KyW FBQMzVApl3YdQEwqIgHzmB+prdyn8lOgewGHDTrxB6cyI4qEaAaKgTJT3GrZxyG02K1+ TSdlxJhTnoX2JNmgwdM05XigZK93PVUJtxVjhEp11n68CiqksyA74pc/u/OPpxt9q9BF UeKmtqeqfX9r/TYTYx2eJTsNMQLXmEVneF0sgWxDNJ1eCr/UHIaf4+kp8Avj0qP5oa1L XtnUFVoaZTfIkUG/0g6emZ6Bt2VRO/nW2ZKhtbE/jQkjf9BO6CMhc1UwsQJjhKjRh8gW PmKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=w6ea+IB8GJjeujszg/TrE7cnAl73iPO/2FuH5x7Npm4=; b=04RAbPZwi/LRraQiGHrs0sgtosJnQf2MaYf59A9Vtod5FRZUqv0xF6A+Tfz3Cae6bz s1nWo419IAszgIS0zjoATBLdF/qEU57a5R+qx9i5Z10Vs0s3jwLqOxjRXc0PCebnBmHa CiLlAd1Yi6BrI3OcOK4vzbKsFYpPe8IcKpnqcGOL0F9B3wADa/o6f9Wyo1qEii6SxzXV sn/NcGsPi7d42eN61Cu5jAwxoQVRVLJj+oka5hbQDH11ZU5vRVb9+oq52Ov5DXptK99w b0RBYVCsc4Y6iw1dm2eKBio9fR5PDYuXSsFWPR0rMl4Q9hF7KxVHEKp7Kz7WvSs2t4jC mirA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eVFt1pra; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ip11-20020a17090b314b00b00219741bac53si5224953pjb.123.2023.01.07.10.29.12; Sat, 07 Jan 2023 10:29:19 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eVFt1pra; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232971AbjAGS1d (ORCPT + 54 others); Sat, 7 Jan 2023 13:27:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232647AbjAGS01 (ORCPT ); Sat, 7 Jan 2023 13:26:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7104A40C08; Sat, 7 Jan 2023 10:26:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BE900B80707; Sat, 7 Jan 2023 18:26:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 14232C43325; Sat, 7 Jan 2023 18:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673115982; bh=SjEXDcxd+wP5nx2Qt2TI3P4sxguFwMHIJck6CTMy4h4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eVFt1praUtSy9SLyuRZ8HK6ttWVjZLhbVuOWZ1UP2GaH4eBiGK8qMXCkAwo54KPEQ BdNulawL+1EDpxs5TDDEcBmweHmDf5VzjX9o5nrLl2iUgvc3Rptrjkf7pqldfjvddF xrRShUmkxSZxF6x4nSZZY9VikQdM/u4kb/macdtJnxG6U/EC7DDM9igF3HjKwhHe1P SJh4HL/vFZvt4UIBvGWvpAmXWuaAJ2JKPxvI3oT6a4JjbQy4Ty8XoZxtcaehoEF43z 19NdBItXL21Uy9WazM+XIJ5XmsH/pZIZOcK0NrqOpOhd4gWHyJ5ZnKksWoLxJ5FJ5u op4HsJFaydwjA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 054BFC54EBC; Sat, 7 Jan 2023 18:26:22 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint Date: Sat, 07 Jan 2023 19:26:28 +0100 Subject: [PATCH 14/15] backlight: tosa: Use backlight helper MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230107-sam-video-backlight-drop-fb_blank-v1-14-1bd9bafb351f@ravnborg.org> References: <20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org> In-Reply-To: <20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org> To: Nicolas Ferre , Helge Deller , Alexandre Belloni , Claudiu Beznea , Antonino Daplas , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Robin van der Gracht , Miguel Ojeda , Lee Jones , Daniel Thompson , Jingoo Han Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-staging@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, Stephen Kitt , Sam Ravnborg X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=1164; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=TiWKXtIRXmpUw/px6HIrIXkwB1iOud1SvGNIg23j2tc=; =?utf-8?q?b=3D58e624VDMkDH?= =?utf-8?q?ye2VhFgLUprGgEmC4cjpB62XJtnFRSF9zXBgn6AjMkxv5uKzvqWz18/h1I4SuRN7?= d8AnGMa0CQN1M+u17H3W2BQG2L5Klm/uDXn9OmNUOoeaOkYVE1n3 X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Submission Endpoint for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephen Kitt 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 Signed-off-by: Sam Ravnborg --- 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 f55b3d616a87..cb07f13dd886 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.34.1