Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2155879iof; Tue, 7 Jun 2022 21:37:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7Gded+EypiIznEIQmY+CGpMvWEAvHgMxx6iWGoJae0+1zyWqgEQEzZ8YzjuRHWGK9ch74 X-Received: by 2002:a63:4d08:0:b0:3fd:8436:edb5 with SMTP id a8-20020a634d08000000b003fd8436edb5mr15518424pgb.427.1654663055515; Tue, 07 Jun 2022 21:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663055; cv=none; d=google.com; s=arc-20160816; b=NmVhC3LrgwXF/o0xtyS0IVxvxZxDrJpgZPvQJm4xXaQ4O9S5/In16wC/QBM9G0ueOu R8neCTS6DT9aQu0qwPoy8TBpMXdnT1CIQJKOecFTVL8bvCxvLIfxviYkfZ5wtEhmJoKD umXOAfCT3Z/CLLyjYyf81QoCOFLA3GmUuP+uOavnp/bk8+pSM+XLzTbf0QMqSTFCcIB/ il8Rg2QkPID4P0YewFGnbcCLhfxhQXyFHmrZuAoWUXCQXcAkFw8eEeeImbAdbzg995O6 18TlnfxbPqBXchT4qLvJVPLIAznqHfvbkDjJ3tjKZuBXus4UtCbrgJiyWfIouyg7glPb KrjA== 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=hKCQKkrwrN9aK2VIlHLPrmv0kXH3JtYz9My0IyFpP5U=; b=V6sSSmtaV2UA8+rmXjTVeJcMN8GVu30blS0Xz0F6h2ZLkz75XbTSVkRZo214sjh0BM pXEv5WQiy+MjCRz84Z0F2DSuo714ztiWahDtJgU9cVdFHKuODLdn3YOqcXUvbt6BktJk cpK73vp0IF48XzQtajGpUrvsK7VQm7lOoVKxeNdxh0+GouxMdamBgxxvpIeu7fcyJmCx MWUXA+5yaqIb1btfzSn/+CJAmRwDhVf+bwjx2yda0EeRx7nGVg6IZgTxEj1n4SmyvTUy sApG+KzlYRBwU9hnEyrS6rj1hI8Kawu5kCj7EMF38KzQgQpxNDwVqQKJxUO006AsDBlO nqvQ== 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 x29-20020a63171d000000b003fbb430e4f8si24530326pgl.96.2022.06.07.21.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:37:35 -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 91A842534F2; Tue, 7 Jun 2022 21:08:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384752AbiFGWpD (ORCPT + 99 others); Tue, 7 Jun 2022 18:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380639AbiFGVbF (ORCPT ); Tue, 7 Jun 2022 17:31:05 -0400 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 231BC22A472 for ; Tue, 7 Jun 2022 12:03:17 -0700 (PDT) Received: from player796.ha.ovh.net (unknown [10.110.208.89]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id C9F2624497 for ; Tue, 7 Jun 2022 18:47:39 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player796.ha.ovh.net (Postfix) with ESMTPSA id 940D82B437457; Tue, 7 Jun 2022 18:47:29 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R003051d3411-4c77-4f1a-9d56-85e7694b308c, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: "Lee, Chun-Yi" , Hans de Goede , Mark Gross , Cezary Jackiewicz , Henrique de Moraes Holschuh Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Kitt , ibm-acpi-devel@lists.sourceforge.net Subject: [PATCH 4/4] platform/x86: thinkpad_acpi: Use backlight helper Date: Tue, 7 Jun 2022 20:46:35 +0200 Message-Id: <20220607184635.1127913-5-steve@sk2.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220607184635.1127913-1-steve@sk2.org> References: <20220607184635.1127913-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11334152890935182935 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedguddvlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejleeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheejhe 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: Henrique de Moraes Holschuh Cc: Hans de Goede Cc: Mark Gross Cc: ibm-acpi-devel@lists.sourceforge.net Cc: platform-driver-x86@vger.kernel.org --- drivers/platform/x86/thinkpad_acpi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index e6cb4a14cdd4..a9337bd1d125 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -6796,10 +6796,7 @@ static int brightness_set(unsigned int value) static int brightness_update_status(struct backlight_device *bd) { - unsigned int level = - (bd->props.fb_blank == FB_BLANK_UNBLANK && - bd->props.power == FB_BLANK_UNBLANK) ? - bd->props.brightness : 0; + int level = backlight_get_brightness(bd); dbg_printk(TPACPI_DBG_BRGHT, "backlight: attempt to set level to %d\n", -- 2.30.2