Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2172622iof; Tue, 7 Jun 2022 22:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwZuo5mPZats5ugsDOT4b71Wa159vxjaY5X96oT5tARTm8P9v3HY4f8YTXNjoqRdlPdQH8 X-Received: by 2002:a17:90a:a614:b0:1df:8aec:cc71 with SMTP id c20-20020a17090aa61400b001df8aeccc71mr35468567pjq.82.1654664897441; Tue, 07 Jun 2022 22:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664897; cv=none; d=google.com; s=arc-20160816; b=qIVCT5g7hihqYbgKlt+CrOh4HIHHD+op9T6jTM9D3iZvan1aQDDJouoYqBonk6P2Rw bBbq18YMZzvYZu443FAHSwLoSlrhPmiJNuqwZEPj71BEdDiN4fkuZBlXG1gFmQUKxmed wfi+jMCtV0MI/nflfIW4Mo0OcpRFxv/wd/AO0p3mCs6aeq3qh1+QBj5lKHLUuviqfl94 aAV9x1r/x5qWOg7tEvefQ2eNh/pMTpJYS2IIjQSW2jS+CekBB7BYYqW3/0Q2Y6+Wpt55 T3PJ+fchgaPppFEgO5rJNkWZVvgQXXPN1TQUrfFo74diQ6W686NkUwF3Y4QMTe0Ih4Ny 1bbg== 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=6WQ6IqKkJfuj4R+8c7+zMpFcA/pUIMcuPrTGlNNac9Y=; b=Gr9mDxf/J+pC/cM6g7VX7QlwlMjhuvtPHj1RhDsa5bv1rvQhvLObGkq4vMi3Pu9IZN LTMCe97kGaUk9a6upeJMeqwWSICeM3y6bM5y2EtQCIU65+8PDkJSj3iuZW+1I8wVTb97 qZj2NMYTIuiZqU0eUx6Q3M14vdozzFMM3P6QMh8P2/48w6RWuXTCWWo3KOucFFlkIYVM Gw4qEhuYCdBk/fZ0sGQ4Jy5NBXWRVQ/yCqYODJhHism4DMkYLd7AKiJhbEW3EMBaOsAs QH93PEgIguWwzBBisccmM5i3xUXHgn2/guu4YSDetyT0pqn8vGRXPglrIw7ztqBk9WZC FXBA== 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 e8-20020a17090301c800b001567a9b37d2si29507661plh.62.2022.06.07.22.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:08:17 -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 43C3C26E89B; Tue, 7 Jun 2022 21:35:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382757AbiFGWAJ (ORCPT + 99 others); Tue, 7 Jun 2022 18:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379276AbiFGVCS (ORCPT ); Tue, 7 Jun 2022 17:02:18 -0400 X-Greylist: delayed 465 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 11:47:22 PDT Received: from 1.mo581.mail-out.ovh.net (1.mo581.mail-out.ovh.net [178.33.45.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7FBD59326 for ; Tue, 7 Jun 2022 11:47:22 -0700 (PDT) Received: from player796.ha.ovh.net (unknown [10.111.208.240]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 688A5246D0 for ; Tue, 7 Jun 2022 18:47:20 +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 75B782B4373EA; Tue, 7 Jun 2022 18:47:11 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R003534aca89-ad90-49e3-97a3-d35d654dc552, 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 Subject: [PATCH 2/4] platform/x86: apple-gmux: Use backlight helper Date: Tue, 7 Jun 2022 20:46:33 +0200 Message-Id: <20220607184635.1127913-3-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: 11328804866083751558 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedguddvlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejleeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekud 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: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org --- drivers/platform/x86/apple-gmux.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 57553f9b4d1d..ffe98a18440b 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -291,10 +291,7 @@ static int gmux_get_brightness(struct backlight_device *bd) static int gmux_update_status(struct backlight_device *bd) { struct apple_gmux_data *gmux_data = bl_get_data(bd); - u32 brightness = bd->props.brightness; - - if (bd->props.state & BL_CORE_SUSPENDED) - return 0; + u32 brightness = backlight_get_brightness(bd); gmux_write32(gmux_data, GMUX_PORT_BRIGHTNESS, brightness); -- 2.30.2