Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2205216iof; Tue, 7 Jun 2022 23:09:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEevQxvKFGJwsAcoRTKCywy3Ky7oqkbEuBWZE+SrGWIyUaMvkP0RybBVXE1kvJ6XKP8EdQ X-Received: by 2002:a05:6a00:b8b:b0:51b:eefc:7fd2 with SMTP id g11-20020a056a000b8b00b0051beefc7fd2mr22983598pfj.74.1654668572631; Tue, 07 Jun 2022 23:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668572; cv=none; d=google.com; s=arc-20160816; b=hP4n+pCyyg7eNKXf0eIqH+Zd6PSsCScypdaw+QzA6iV7ZmTud/HlCo8YKPO7JVCDpk zNc7m0WeN5uAmw5StlsS/6RZUxWLzyJeCyLSx63yackT9AT8jv37JGR/wtKIq2E2LNjS bG7kgUCyKzHLJOmxeWRUx3RBqoapKymjuaWIWFKkmBDXumLsJqfVZm6athWixULfQBIu d1LkJr6nQvElXaoEaO9MsHjaWj/zK5oA8XPiJlGR0G7nvrkbOnZsjzgQuOIBlgdgIxOg k9XyLRzQAEG0fD8b90DTecvQbPJHAr7zGG4aiXx/BeICSFzGOmGrvhQFrISzzbEXHgYm sXvw== 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=A6fFwLmM6QP5gD2Ysv1U8/EIduVJpKsZ/NBdq48ZmR8=; b=XJZP3z867AoCqeHuzenx4YEWRKw0MjVuPrHyhftJQd7hRa+1QTziNqo+g9N4HjvTWV QzU3JJIHBJA9nnHGLEsKC1y6YC+yQAqWeW3dCm1kA29wI/hSbMfwSI++GvH+M0Zo9dYu a9wVLX1zUxUKkHfIhde9fiiY0+PD3hdGRtJallSvQ46H0wyqHpSVJZsFVkxz9Yrc6w61 YsxGAgO6ZKFiaalAIu7C8oAPYcepyyKqKFanOlg+eFD4CDW3VO5SLOe0Wh6/uleM5a2r AnbVRu2Lm+2SFv1jEf83Wovm27Biq7MdqgGBVot51cz3pS3N4J5RJnXEX4IGW0lt9g1q SiXA== 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 i69-20020a636d48000000b003d8204bc333si30169686pgc.616.2022.06.07.23.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:09:32 -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 2400827621B; Tue, 7 Jun 2022 22:32:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239463AbiFHBd4 (ORCPT + 99 others); Tue, 7 Jun 2022 21:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385572AbiFGWbi (ORCPT ); Tue, 7 Jun 2022 18:31:38 -0400 X-Greylist: delayed 891 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 12:24:50 PDT Received: from 16.mo550.mail-out.ovh.net (16.mo550.mail-out.ovh.net [178.33.104.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 522E7279E54 for ; Tue, 7 Jun 2022 12:24:50 -0700 (PDT) Received: from player698.ha.ovh.net (unknown [10.109.156.73]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id C38C321165 for ; Tue, 7 Jun 2022 19:24:48 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player698.ha.ovh.net (Postfix) with ESMTPSA id 7CF082B4804EA; Tue, 7 Jun 2022 19:24:38 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-110S0043757001c-4f3a-4d1c-ba12-6ec75814bbad, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Antonino Daplas , Benjamin Herrenschmidt , Helge Deller , Paul Mackerras Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Kitt , linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 6/7] fbdev: omapfb: panel-dsi-cm: Use backlight helper Date: Tue, 7 Jun 2022 21:23:34 +0200 Message-Id: <20220607192335.1137249-7-steve@sk2.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220607192335.1137249-1-steve@sk2.org> References: <20220607192335.1137249-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11961560612720903913 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgudefjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrheileekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehtd 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: Helge Deller Cc: linux-omap@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index a2c7c5cb1523..236430b5dc52 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -331,13 +331,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev) struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); struct omap_dss_device *in = ddata->in; int r; - int level; - - if (dev->props.fb_blank == FB_BLANK_UNBLANK && - dev->props.power == FB_BLANK_UNBLANK) - level = dev->props.brightness; - else - level = 0; + int level = backlight_get_brightness(dev); dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level); -- 2.30.2