Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2188454iof; Tue, 7 Jun 2022 22:36:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo7WMeyv0RLCwxl04Cdh//FE8MnrBXRtHSx9h/ozwKAX1S/BC8S9DOLOg4jnrEG+fu33Y6 X-Received: by 2002:a63:86c8:0:b0:3fd:9e47:65e6 with SMTP id x191-20020a6386c8000000b003fd9e4765e6mr13965665pgd.554.1654666598025; Tue, 07 Jun 2022 22:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666598; cv=none; d=google.com; s=arc-20160816; b=kZ2W8nw6yDVu7URZlRd1Waei3loqkrvnOb8i3YMxTJV6FDmco1X1SttPrgBk4irZrm ZnOxj0FPd6OFIxyprGYMHFsLEJJJ6BimXhePNG5zrmHA1DuBeSC1nx9VeSMS/5XHnT5B balIaLTsUkGXTbbS5cDRbtO9dTURhDB3xIl2qL4tCChiLxpRhkYVoWH8q0Z6EI+S8dT1 AHODpz+uxDpZ6Cw63TCY4TlBlLIvbFf0umPMtxrbotZDu1LPFJ1xcXZGPrapZfBOnGsK e5a6FpBQuxwHX4Toyd24wNcbkUGugJPiTrvWRfz9N66f2X817bWT2d0xCYvYz8XfK2kM G7BQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PWdNl/cdURJ3l3+NMsplLfXbNcETELnsEjwgx/lbptM=; b=cfZF8aanAwNTScRW4FS7JkhhLUh45F89uveyr3FLONyob2iDfseTEFPPX254xBN2Es ncwuu8Z/IvtMTfT4QwZq+mjv+/7/7otWRzqCfhzrS4EmNoONpTItY6Cb344FlMb7SR1K wqUFK1evc5ML9+nQMeDvkAuVk7kAeHcvI1pPF5EYiUlpd/1XWuEkgm5BDaupCmUqapbm CGuMQ+vJDLnwzU81t+nzwDFulhnrX9VF0ADyNoIl9ocFsd4ZAgYz98ImIibYl8+dk+1B vvhUcqTDqUoQ3LJu4kZxLAGgv+5zC0y3JUaDZUK132jNvBUlMxgcougm6Qq7XGw8KPc3 cypQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n4-20020a622704000000b005184296cd5bsi24027793pfn.344.2022.06.07.22.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:36:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 048BA49F6AC; Tue, 7 Jun 2022 22:13:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388149AbiFHAbj (ORCPT + 99 others); Tue, 7 Jun 2022 20:31:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389413AbiFGWxR (ORCPT ); Tue, 7 Jun 2022 18:53:17 -0400 X-Greylist: delayed 842 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 12:48:30 PDT Received: from 6.mo583.mail-out.ovh.net (6.mo583.mail-out.ovh.net [178.32.119.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65CB62DE7FB for ; Tue, 7 Jun 2022 12:48:24 -0700 (PDT) Received: from player797.ha.ovh.net (unknown [10.108.1.161]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id B0CE7243A9 for ; Tue, 7 Jun 2022 19:10:24 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player797.ha.ovh.net (Postfix) with ESMTPSA id 894BD273DCB28; Tue, 7 Jun 2022 19:10:15 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-102R004c1185a33-f4c2-4b0e-9337-679f3581da73, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH 4/4] backlight: tosa: Use backlight helper Date: Tue, 7 Jun 2022 21:09:25 +0200 Message-Id: <20220607190925.1134737-5-steve@sk2.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220607190925.1134737-1-steve@sk2.org> References: <20220607190925.1134737-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11718366230841099910 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgudefgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejleejrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekfe X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han Cc: Helge Deller Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.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 6df6fcd132e3..5bbb769f9746 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