Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2205150iof; Tue, 7 Jun 2022 23:09:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSgzCwmSD07Ct4OrfiNE3obIdvUHlY4d7VUyaCenhQsbWXEH3Ou23VYgFSXvWC+RUHVehG X-Received: by 2002:a17:902:b418:b0:166:3165:eaff with SMTP id x24-20020a170902b41800b001663165eaffmr32843353plr.96.1654668566848; Tue, 07 Jun 2022 23:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668566; cv=none; d=google.com; s=arc-20160816; b=z2aFfWgtE30GZzlCBCJ32p1eiBzOCRaBw07DPECFtBQhxIiQZvIos01Nfv65Yn7IX+ MPENLjKGYNJvsFS29jOh3TIzW9ZbIXEFcorbPB4OqVJtaCPbBmvaggtC/bpajMwBMaSk M3FKOrjmaxBqz9IVaPcT2154bcpG3Va9ChefM0Km54V3LzGkkxXprIA6YhYTTTRHzC3O 6l6S2NdLlDk1kR+H5lGRo0eqif/ojiTkwC8Sid7DmCs7CxhARTN6h+eMBzybq1wenKe9 fgDMZL5nM2EEvp866Lf52ZAWSHEk5Epns1s/9PkZp8lgeT+fkCqjQTLqGvVfo0cpoCA+ owXg== 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=HKYx9SA2vpOqDj38OU3zC6DfY3q/4Gi274ttCP2cTfE=; b=JoE4pZvf2zTjvhIyHODHt2HpRI0ZH6DNfCaerrF5ptcjhRV+KCq+hzoevr2B1r7AYq lRxfUE/8h33iXSRGbECW0tjOdD2IyKHXnKVB2yFxvCF0tV311doxHmjfO36770xFBcTR MtxYO4Fn0birtJHBEv3LSkJyM5P+euQbDUht1KwsC8uUhXyxvYm8zcLClJgpphKRlgud SmSLe69Bt7dOkwvEtMIV8ReJzha63cTQiw6oNuhgpXD9YqYTqJ9ZYhHzn81hBsJjnpSn flm03aWdR7T7TyzyovMRhRIxaI0cplfa0OJMdPzVBPkfSPAkX9TGo3KzPLjuIYdNr4z9 I2WA== 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 z15-20020a170902cccf00b00163c52336fbsi10304526ple.369.2022.06.07.23.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:09:26 -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 767821673C3; Tue, 7 Jun 2022 22:32:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388082AbiFHBlU (ORCPT + 99 others); Tue, 7 Jun 2022 21:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385631AbiFGWl5 (ORCPT ); Tue, 7 Jun 2022 18:41:57 -0400 Received: from 18.mo581.mail-out.ovh.net (18.mo581.mail-out.ovh.net [188.165.56.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9C428B5F4 for ; Tue, 7 Jun 2022 12:33:15 -0700 (PDT) Received: from player738.ha.ovh.net (unknown [10.110.208.160]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 2A917247F6 for ; Tue, 7 Jun 2022 18:55:35 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player738.ha.ovh.net (Postfix) with ESMTPSA id 98BE12B7105E6; Tue, 7 Jun 2022 18:55:22 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-97G002c3165992-545e-42a9-9988-75529117242b, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Greg Kroah-Hartman , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Thomas Zimmermann , Andy Shevchenko , Javier Martinez Canillas , Len Baker Cc: linux-kernel@vger.kernel.org, Stephen Kitt , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH] staging: ftbft: Use backlight helper Date: Tue, 7 Jun 2022 20:55:16 +0200 Message-Id: <20220607185516.1129900-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11468134978585724588 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgudefudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomhepufhtvghphhgvnhcumfhithhtuceoshhtvghvvgesshhkvddrohhrgheqnecuggftrfgrthhtvghrnhephfevveeuhfduuedvteduheduveekveekkeduteduiedvkeejgeelveeuffetteetnecukfhppedtrddtrddtrddtpdekvddrieehrddvhedrvddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeefkedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehsthgvvhgvsehskhdvrdhorhhgpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehkedu 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 manually checking the power state in struct backlight_properties, use backlight_is_blank(). Signed-off-by: Stephen Kitt Cc: Greg Kroah-Hartman Cc: "Noralf Trønnes" Cc: Thomas Zimmermann Cc: Andy Shevchenko Cc: Javier Martinez Canillas Cc: Len Baker Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Cc: linux-staging@lists.linux.dev --- drivers/staging/fbtft/fb_ssd1351.c | 3 +-- drivers/staging/fbtft/fbtft-core.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fbtft/fb_ssd1351.c b/drivers/staging/fbtft/fb_ssd1351.c index 6fd549a424d5..b8d55aa8c5c7 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c +++ b/drivers/staging/fbtft/fb_ssd1351.c @@ -196,8 +196,7 @@ static int update_onboard_backlight(struct backlight_device *bd) "%s: power=%d, fb_blank=%d\n", __func__, bd->props.power, bd->props.fb_blank); - on = (bd->props.power == FB_BLANK_UNBLANK) && - (bd->props.fb_blank == FB_BLANK_UNBLANK); + on = !backlight_is_blank(bd); /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ write_reg(par, 0xB5, on ? 0x03 : 0x02); diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 60b2278d8b16..9b3eaed80cdd 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -137,8 +137,7 @@ static int fbtft_backlight_update_status(struct backlight_device *bd) "%s: polarity=%d, power=%d, fb_blank=%d\n", __func__, polarity, bd->props.power, bd->props.fb_blank); - if ((bd->props.power == FB_BLANK_UNBLANK) && - (bd->props.fb_blank == FB_BLANK_UNBLANK)) + if (!backlight_is_blank(bd)) gpiod_set_value(par->gpio.led[0], polarity); else gpiod_set_value(par->gpio.led[0], !polarity); base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 -- 2.30.2