Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2532270rwl; Fri, 6 Jan 2023 07:41:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXvnXHyIzCmidF1zp0pjrD4Whvegp4ID6cHM+CtEgetk0RKC9LP9HAG+dak46gbwe6ZWB5Eg X-Received: by 2002:a05:6402:b6c:b0:48b:8e65:6029 with SMTP id cb12-20020a0564020b6c00b0048b8e656029mr18157434edb.26.1673019674006; Fri, 06 Jan 2023 07:41:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673019673; cv=none; d=google.com; s=arc-20160816; b=MLYb68qzAedfzRMeg2RLRp7l9OQ229lhMtR3oENwBt6MIpOPKxmeBcnKbJxipWRVtX 71xSk7qM9h2kUDn045Sin40Sbq8UC5meA/iTM75ffxVFwsSW3MXuuJ2Knzsxn0GuD+qQ X8CWqlrFogWcqFz4/xlW4Qnly57nhMZ28VpwNfLLAWelikt+CCk3OIZ4F2HXAZjXqrHg 5IzXwDMeuvUXv3v8sNcfB1Vgn/Etvtdmn0ANmabSgavss2XqszRIaXgEBDJkNvgq/dV1 eJ7YjJjjzV8WOHSQqYNV363GS03G6OkPbRkbkBmnCYKsvHyuinzZDYEZfRe/0IamC9Ni JqSg== 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=cqpfB1Q4iA3dhDrj7wSO+PwOvZCRjy4Ms46Fc4V5jww=; b=Q4enEcm7yA8M7JF0VSFBqo34YGzzHF9Voj3Szna2UjAOGRgnohuPgcf20KQmhNRFoo oIFyGtqR30XF+NdchOmy1axav9GYNHsZT/zEadQUVe38THvZPXTKRGVrEMWKfGCrhkbC SzdEf/SfkHXuiJYQO//LblqpDLHIzf/g9OVfwTLvJbiVujD1EM/f9N2SRo7uPQQfbK04 7YARFB/15GOyRh0vDf/PSdxNotnjZLEoTDQldQMhJ+EWEeUF2sKb1ov28eewtzmy4ImZ YX/zBorbsfxVmvym5dIfGlJzbl8yWDM8/dnAWrJIUfl9kef2bpaDzQ5/KpO/+94JAIZK 8TaQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne30-20020a1709077b9e00b007c0abf0760fsi2002799ejc.54.2023.01.06.07.41.00; Fri, 06 Jan 2023 07:41:13 -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 S233967AbjAFPIS (ORCPT + 54 others); Fri, 6 Jan 2023 10:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbjAFPHw (ORCPT ); Fri, 6 Jan 2023 10:07:52 -0500 X-Greylist: delayed 2230 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 06 Jan 2023 07:07:36 PST Received: from 10.mo575.mail-out.ovh.net (10.mo575.mail-out.ovh.net [46.105.79.203]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514C0777D9 for ; Fri, 6 Jan 2023 07:07:36 -0800 (PST) Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.146.76]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 272CA25ACD for ; Fri, 6 Jan 2023 14:30:25 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-rqjmb (unknown [10.111.172.194]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 700B11FF2C; Fri, 6 Jan 2023 14:30:24 +0000 (UTC) Received: from sk2.org ([37.59.142.97]) by ghost-submission-6684bf9d7b-rqjmb with ESMTPSA id lBj7FYAwuGPZygAAJ5VTDA (envelope-from ); Fri, 06 Jan 2023 14:30:24 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G0024d129192-3f53-40a5-8aba-33e6275bc708, 9FE29456621203A27B372E1E0503D45BE0167874) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Robin van der Gracht , Miguel Ojeda Cc: Stephen Kitt , linux-kernel@vger.kernel.org Subject: [PATCH v2] auxdisplay: ht16k33: Use backlight helper Date: Fri, 6 Jan 2023 15:30:01 +0100 Message-Id: <20230106143002.1434266-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3495074787925264091 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrkedtgdeiiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeoshhtvghvvgesshhkvddrohhrgheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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 backlight_properties.fb_blank is deprecated. The states it represents are handled by other properties; but instead of accessing those properties directly, drivers should use the helpers provided by backlight.h. 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. This means that BL_CORE_SUSPENDED is now taken into account, as it should be. Signed-off-by: Stephen Kitt --- Notes: Changes since v1: mention BL_CORE_SUSPENDED. drivers/auxdisplay/ht16k33.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index 02425991c159..15ab118c80f5 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -314,14 +314,9 @@ static int ht16k33_initialize(struct ht16k33_priv *priv) static int ht16k33_bl_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; + int brightness = backlight_get_brightness(bl); struct ht16k33_priv *priv = bl_get_data(bl); - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK || - bl->props.state & BL_CORE_FBBLANK) - brightness = 0; - return ht16k33_brightness_set(priv, brightness); } -- 2.30.2