Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2035374iof; Tue, 7 Jun 2022 17:41:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7PSzvl8tJvO+8aUi0d8SnF282rYIQF7OcltpaX0TH8wwA/S7nD9f+jprDmp6zn0aPE1hV X-Received: by 2002:a65:6808:0:b0:3fd:208f:b764 with SMTP id l8-20020a656808000000b003fd208fb764mr21510304pgt.484.1654648910586; Tue, 07 Jun 2022 17:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654648910; cv=none; d=google.com; s=arc-20160816; b=TWj6yPmnFfJM3LiTPyWeNJQ72IA7FqibEHAk0sw9VQ5g3QOAK7EDqoT23mEbbKmKYt EIwZsEwiPHNUDIQMeVZBN6TWrF2v/HpoYchWz3MI9m5TUGmgxI2cYnuM/VKlw5nRVu1U 4b9cUGVwlG0/lUsj0xqO4IDjj6idEFX1nbj2uCITe88LxJEmjpCXRmkPgfswtFcW1OS1 233GDisLlTNDH0UXDD7NRk9ibKsbuT3CdG6EwNt4nxfPgjaXv/w8QPE6W4IdMxdKv8zm unRh/ZqEoZLlVUXbwVDpgvmRlS8yi+rEH7v/ck6y+mUJ2/t6OOF/UX2/mjRj8KSOVwjt 4kTg== 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=mfUptBlQbiIy7ztmYemSIRtwdHW+GnKTO666sXrc5Hg=; b=tRdT7ALoc09TCOd9G2iVDuTWdZVz9LebCh7NgJt5XHdXe9GmzUtJeoNAhWynth7vvl Aa5d/mMcGDIPNRKZThtLCwIFuQxh+1jjz8tJsCVPJtVz7Ko3H31iuYLPGOceBkV5G3vv NtDcLkAuEi9NWVSGkJAg3GLC44i/6OS+xodMwsk1EytAnTzs1NAhHjzNN++44r2AMgGf eZAKekEXGogw2l02AM6ooiomzbobBBEnv379G8P/Oo8ZW+neaaMkZbjBg/eV4GQLwJSa UO9Vy8RcH5/T7i+MjsfIKL7EuxHCXLO93FNst9+05ZrnNWkKjyAS7GYk08jRQblApSi4 M31g== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j65-20020a638b44000000b003fcd7df81cesi25779937pge.652.2022.06.07.17.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 17:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 E5A0E12C949; Tue, 7 Jun 2022 17:34:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385942AbiFGWmQ (ORCPT + 99 others); Tue, 7 Jun 2022 18:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380601AbiFGVbD (ORCPT ); Tue, 7 Jun 2022 17:31:03 -0400 X-Greylist: delayed 595 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 12:03:14 PDT Received: from 4.mo560.mail-out.ovh.net (4.mo560.mail-out.ovh.net [87.98.172.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C88AC13F40B for ; Tue, 7 Jun 2022 12:03:14 -0700 (PDT) Received: from player158.ha.ovh.net (unknown [10.109.146.86]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 85EA721D9F for ; Tue, 7 Jun 2022 18:53:17 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player158.ha.ovh.net (Postfix) with ESMTPSA id CF6072B4B06CA; Tue, 7 Jun 2022 18:53:13 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-98R0025b23b570-e9a2-4f30-9c24-99b8b7f3b651, 2B697642B4708974A8072F1FAB3368C632332CFF) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH] regulator: rpi-panel-attiny: Use backlight helper Date: Tue, 7 Jun 2022 20:53:04 +0200 Message-Id: <20220607185304.1128962-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11429291431109691014 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgudeftdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhduheekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheeitd 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 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. Signed-off-by: Stephen Kitt Cc: Liam Girdwood Cc: Mark Brown --- drivers/regulator/rpi-panel-attiny-regulator.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c index fa8706a352ce..105f694a67e6 100644 --- a/drivers/regulator/rpi-panel-attiny-regulator.c +++ b/drivers/regulator/rpi-panel-attiny-regulator.c @@ -187,15 +187,11 @@ static int attiny_update_status(struct backlight_device *bl) { struct attiny_lcd *state = bl_get_data(bl); struct regmap *regmap = state->regmap; - int brightness = bl->props.brightness; + int brightness = backlight_get_brightness(bl); int ret, i; mutex_lock(&state->lock); - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - for (i = 0; i < 10; i++) { ret = regmap_write(regmap, REG_PWM, brightness); if (!ret) base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 -- 2.30.2