Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2108917iof; Tue, 7 Jun 2022 20:02:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNaUnn11F8k6Rt3XvULEX8sO3/+hKAePKW8lnoRU4svXeBvNSjLtmxB7osu/BgInQ/PNOM X-Received: by 2002:a17:90a:c981:b0:1e6:75f0:d4ea with SMTP id w1-20020a17090ac98100b001e675f0d4eamr36820484pjt.37.1654657326724; Tue, 07 Jun 2022 20:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654657326; cv=none; d=google.com; s=arc-20160816; b=jbSl+bhu0G4aDn36db1u+gnqUsIu2tZTegbZbQmhsmd4DUHC6vKupCmLfsrPzCP0J+ TLt+FxXOJJkT0OHO+BuFBQJsAnsuLYQq8kPwcZlX0/gUvkDdI6z57bYTaFtaHYZM/NkS +suspH2cE7pgqD6Vc/DMNOPouIPbu4TI+AB5SVWQou8AiGOlXN5HQDnewLPsbGv4u/Gj u5krmR04QtKNSFFVfqObHOBArAYR/2SH2iva2DgfgFAxAwCFBcQudynErKyo6Qg9db/u ugaAtK6YAh6AbZPIM7CLcLbB5pnI8OmWORXSHy41uiKr4Na8aA6aa31nXQgTycexAPIE HFlA== 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=jf57v3YaSnyHVSCWYfYnrEmEFsv4ia4OKjH59S0R26o=; b=sYfv+gedxy6w1mqFjzaR4BBHO8+Y66mue0ul4y0Llh1PhhyIm+5q/ytxVffb/25pSo ovtYgsy4VJ5FCu5tLYVvWzZUomjb5LEj3lUqLQqBCBxh493n6Xkon6ezXOicDvYsOKf0 XIiV6BmQqiGdy+rsjPMt/yBGcCdQx3hF2t88IXHgUlLkOAiCxd+Eur08tPe+39We/ErN faBrH9jkvcTClz9/OqBTXgkl/yviVux+rQjutGzdrut+85RyfmK+ikJ2zDv6BEQbfE+N 6PR0vDdAglkcxi1zjkRhh11MSPR2IDMwc9LkgTzzp1ggSu54g38ce7Y5K2YEVIlMcP9G bCSw== 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 v4-20020a17090a898400b001e2e267a475si24229386pjn.129.2022.06.07.20.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:02:06 -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 8C47030AB46; Tue, 7 Jun 2022 19:03:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381819AbiFGVpC (ORCPT + 99 others); Tue, 7 Jun 2022 17:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378932AbiFGUwm (ORCPT ); Tue, 7 Jun 2022 16:52:42 -0400 X-Greylist: delayed 277 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 11:43:22 PDT Received: from 8.mo575.mail-out.ovh.net (8.mo575.mail-out.ovh.net [46.105.74.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 692083F332 for ; Tue, 7 Jun 2022 11:43:20 -0700 (PDT) Received: from player746.ha.ovh.net (unknown [10.108.16.8]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id B9FFC22A18 for ; Tue, 7 Jun 2022 18:34:27 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player746.ha.ovh.net (Postfix) with ESMTPSA id 6A0ED1DF14EEC; Tue, 7 Jun 2022 18:34:21 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-108S002f51240c6-cd04-485d-92a4-59fa50673865, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Benjamin Herrenschmidt , Michael Ellerman , Christophe Leroy Cc: linux-kernel@vger.kernel.org, Stephen Kitt , linuxppc-dev@lists.ozlabs.org Subject: [PATCH] backlight: Use backlight helper Date: Tue, 7 Jun 2022 20:34:11 +0200 Message-Id: <20220607183411.1125030-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11111224708588406284 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedguddvjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejgeeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheejhe 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: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org --- drivers/macintosh/via-pmu-backlight.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c index 2194016122d2..c2d87e7fa85b 100644 --- a/drivers/macintosh/via-pmu-backlight.c +++ b/drivers/macintosh/via-pmu-backlight.c @@ -71,12 +71,7 @@ static int pmu_backlight_get_level_brightness(int level) static int __pmu_backlight_update_status(struct backlight_device *bd) { struct adb_request req; - int level = bd->props.brightness; - - - if (bd->props.power != FB_BLANK_UNBLANK || - bd->props.fb_blank != FB_BLANK_UNBLANK) - level = 0; + int level = backlight_get_brightness(bd); if (level > 0) { int pmulevel = pmu_backlight_get_level_brightness(level); base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 -- 2.30.2