Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2397760lqp; Sun, 24 Mar 2024 17:45:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGML71FUxvClobdsNaDG1gAMUrWNXmahax1Qw0Ad7KRmLAQpGbWMTi+6sUVs7BYQiWwG1iloljlnrVwwRfxqYFanH8K4Ru/75TagJFBA== X-Google-Smtp-Source: AGHT+IHxjusdeZbyIjVQFhNQGZmCksZcmuoD795kCIzFlSQlSyJNJ/1V2NaXTPGBRdFc4z3JX1ut X-Received: by 2002:a05:6a00:139e:b0:6e6:c191:d581 with SMTP id t30-20020a056a00139e00b006e6c191d581mr7206892pfg.14.1711327515179; Sun, 24 Mar 2024 17:45:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327515; cv=pass; d=google.com; s=arc-20160816; b=IqZ2lGMFzo0kfGyNMWOiBIjjuRvNEW8iAjKAOLL/JC1ixXZvqdGcMWaho1y1/T2AO9 N98n88IDurF620ZFv/tGw77EG9JIwmJTc999DbG2j+jI0adhQenO74jBRUrl9bTuTLmg zIQtix8cOPrOsFdvr0QOOJZRocUSloM6Yx9BHUnm10EBYw5TcXib8LOp5DAhlN/QzDrM SLOmp7u6Gru2lkNHU6rTIMqYDzh9doyUMNk1GbUFsPU4jS5agUKEFfl7HBs0enKUWfzZ tfW2h5U9tgnBtm7Hop26zzq66thggRRGfxxlWyjRp3VuS3dMMhysdZRDDOSoSUMnN60a Pffw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wrQND6tVeiML7oSG21bXmIppQMOQFFc7aI09eadCusw=; fh=S4aVjIiCgVcq0ppB54cwCjnJC1ZUjFhmW9AASVlLXIw=; b=sD8nJTCgwAUt0nyJ6ZKfvA+3ZfOwG1fkwu3soHS4b7BOrbJqNN8vFpMz/GPjmRwnVQ t5Mkwqj2AZXV6fAxHs7yDdq9BdDrBy26qNpd+FV5QPv5kFPTV/amXYcHQZRgqqlb98PR O3UHvWEeaTTEY7CycrOtLi5oThinVJZ61lbc2I41AUmZC3vxS30hficT67BGRPLS/dnA kVe3ef9iRU6+0JaBuGhpaMtwRaxvBplLp52QMWT3MyUgtN+6ce4Ar+ABw8XjrFbh2SgF 4mya6YOUcnos6HB0gmBn5RfyBow1sF77UTk+drxsHZgxfdmFMDd90YgESyGotCcDBjLo Mt+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=osCntJNv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113414-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b16-20020a631b50000000b005dc858b5b75si6433612pgm.848.2024.03.24.17.45.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:45:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=osCntJNv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113414-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E1289B22AC2 for ; Mon, 25 Mar 2024 00:30:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 867921A7722; Sun, 24 Mar 2024 22:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="osCntJNv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F4E61A7059; Sun, 24 Mar 2024 22:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320216; cv=none; b=oFshsrhNMKYNE09bgXPBaP93poSeiaTJLpzUEyCCwoJV9Shy3OtY6weuvM9K3hs5VqEwJi054vGAdvyxbIAqs18jZd5/+B6kN3JJsfrAsRvNV4lKNChxn6CfvxW6zaeBwr+2ejYwhBUqKhFp0AjM0wH02aAKBtYWzeimZOTDS/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320216; c=relaxed/simple; bh=bp1Fpbg0r4rOlDDELyrOjAlejZsZMctkuCGncAfZ4/Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fSqNm4vrjw3iIDPIEjVKynfaa26B9Qkt87v4EvZkhoJuAWjmPRLM17X/9AyxrH2rPDUz+mzg2lNNISYUKU654LB7R3eVf6xgpbeJGchmSYrUA2WZRIzUyGBgggWDRKRTWEq2hVs9wv78C4ao32xu6D6I6WxT9KsaBfi4g8DS1AM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=osCntJNv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61FD4C433C7; Sun, 24 Mar 2024 22:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320216; bh=bp1Fpbg0r4rOlDDELyrOjAlejZsZMctkuCGncAfZ4/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=osCntJNvYFEak3E3FvHiJM9GVro1I/hAHWjjjq1y8YrB5XHfkBdmy8TeSTdR7Io5M LJf6IY8CwQVCK8DeGkH/vPxgSHcwOnGInJbAMlZbxpMWtVeJ6vEvo4OVe6djyF04T2 oJaTChtezddAjboM/xHLryvyarjmbkdTVutI6djsU8NLwF2dDCOidzdH3ku5w9PAaR +WxFcbCoyFymEM8BrxvB2AW9AiQ23TXmk1c9w9brZhKQGpriVqanv65le2JXeF6QVT 6Xnpjtq6Ymmw7m9GTKl0FKo5ms5SEBHwTpK++YRYH1xxKOTY8EyQ0MdtJKGnLvxf6P 3Q5U2sPVGHrhA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jianhua Lu , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 6.8 523/715] backlight: ktz8866: Correct the check for of_property_read_u32 Date: Sun, 24 Mar 2024 18:31:42 -0400 Message-ID: <20240324223455.1342824-524-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jianhua Lu [ Upstream commit f1ac3c9825f99c93a9833beee6b78aa386e55b0b ] of_property_read_u32 returns 0 when success, so reverse the return value to get the true value. Fixes: f8449c8f7355 ("backlight: ktz8866: Add support for Kinetic KTZ8866 backlight") Signed-off-by: Jianhua Lu Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20240129122829.16248-1-lujianhua000@gmail.com Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/ktz8866.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c index 9c980f2571ee3..014877b5a9848 100644 --- a/drivers/video/backlight/ktz8866.c +++ b/drivers/video/backlight/ktz8866.c @@ -97,20 +97,20 @@ static void ktz8866_init(struct ktz8866 *ktz) { unsigned int val = 0; - if (of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) + if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) ktz8866_write(ktz, BL_EN, BIT(val) - 1); else /* Enable all 6 current sinks if the number of current sinks isn't specified. */ ktz8866_write(ktz, BL_EN, BIT(6) - 1); - if (of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) { + if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) { if (val <= 128) ktz8866_write(ktz, BL_CFG2, BIT(7) | (ilog2(val) << 3) | PWM_HYST); else ktz8866_write(ktz, BL_CFG2, BIT(7) | ((5 + val / 64) << 3) | PWM_HYST); } - if (of_property_read_u32(ktz->client->dev.of_node, "kinetic,led-enable-ramp-delay-ms", &val)) { + if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,led-enable-ramp-delay-ms", &val)) { if (val == 0) ktz8866_write(ktz, BL_DIMMING, 0); else { -- 2.43.0