Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2377716lqp; Sun, 24 Mar 2024 16:42:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYjyYcRrubiFo4NmMBZHLRMAuBkA5XcUjSWNxZg6yp9B7f0gnn93YJjNDxhJKe7AnAXm3telWrPM+exwUJ0lRYcoamzQa68Pj8As7F3A== X-Google-Smtp-Source: AGHT+IH07bVyf1MlqwRFxjV+8Vv5Amofg+Ro5BHwfqfIo4/iG4IBO+OwwLAsuaRSooMpj0nNet/N X-Received: by 2002:a17:907:970f:b0:a47:47fc:443e with SMTP id jg15-20020a170907970f00b00a4747fc443emr3536842ejc.23.1711323731170; Sun, 24 Mar 2024 16:42:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711323731; cv=pass; d=google.com; s=arc-20160816; b=nYwsqKA9xW3ItruCnZjo/0yhEiZXrGUmwoGqydpfHPxLmWxOEAH0SyuDeVsoPgqFKS cHn52LkZ9/SqWpsFdL2RYTuM9KocFhOQHEakXb8KnCVfWc48o4rRVf492D2+FYZuZwKg ayf8ou9QoqdJH1G8vUrS0XF2Z4RhYaaiidOUsvXRVuktL4zfKCc0+X6VH3KC1GpYsO+g GAbUFZmFQdUgszTPiAJJr2ns5iqmhqAytGKIPOhQ/2oR3qPcUig6nPXHdTyn0g8bcO8P mViAoL76R0Q6fN9rk/HdDQWPFgRKok7Vnbnefe1k8suOiGUbPKzKA0O9L5Nu5P22pvs0 quOw== 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=NBYTqbgZskWkh3SatMvU3hf44DiGe+7yuIF8xE5tDME=; fh=wrCfqp9FeEGAPZBOSVG/ESBWjh4tvHp26vB1wAv7ks4=; b=no72D5rQwv9XkB6Ocyc5jWqtGwC/pbbiQYc7bMzVVDlXkJKakKHy3frMDDHIrlU5/p 66V0wdRsFPDVD/C++s1Yk1HC2UIJIvK1SawBfxAemKi7EDPC2Ha1WjECqyAz6OuXosUN a0wnbHMm4aktzxdQJVSWh9hBLbORp/9KK3NBi5BM+8l8oQphqDM/KLDo16K04+VCP7HJ CEbod69B7kR/rZFwwzVq2FGc5DNa60MpsOHoIwwQ+lgiA0JpncTTMW1OYHHjkpctaUr/ m9NPAGsdrzzJZt+n/KQFG7ETZAPxZOhymcbYbYckkcbsJ60ISV/pp4xfzUp9feXaQoGY Xvvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="f4A1S/wz"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113198-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hq21-20020a1709073f1500b00a474a148d8csi1426786ejc.101.2024.03.24.16.42.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="f4A1S/wz"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113198-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D6E231F219E1 for ; Sun, 24 Mar 2024 23:42:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8665517AFBF; Sun, 24 Mar 2024 22:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f4A1S/wz" 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 8AB5717AFA7; Sun, 24 Mar 2024 22:40:01 +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=1711320001; cv=none; b=MRRyVdxYCfvEh1xFLElrT42tho6BMwmpKb2AC/nT3pYuq7PBRPQPvcfroiywiwyLJjxEacrZT1SPuYDNzw77iOU6o4h153BX8jebXjyw9eaw8VxYeKsh/mU1MxDJeL5fzfVYSA6SlGwG+hpTMqq/z2I3czVPd9l9K7+P9wriG6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320001; c=relaxed/simple; bh=5mSPBjLV0u+Pvcr5pGiX6KSIy1OJMNHkJXXHNu0TY4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P2MBQD3ENJyWBHt4qEeXP/NzF2QUSf3aiKl/B1Tu5WrKzHD8oD/abUDVcZ2BU/fuzR3gVcckVw9Xb4Dc9qfbul9AMkdibLC1sp65YoZNWHkFEvwEpY8dgRW1UErp1hIQxfjxvtDOr/ZqOy3fSOXMQRNu1awXsJMwmwWl80NDBEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f4A1S/wz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE700C433C7; Sun, 24 Mar 2024 22:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320001; bh=5mSPBjLV0u+Pvcr5pGiX6KSIy1OJMNHkJXXHNu0TY4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4A1S/wz81b76DaVTvl8ngdsuHzE6T+iH56Ijufz+XJXmI8FQbVu+fEO/vRgoxnLx EjDGH1tTim1J1xp0+68oxwEK//hjRzdZ/GFX1iptiUWXLqIEoDxgOqddHLuUmkwvoH 1JjtEg4hrpIZeIWLFk5fzaN8B/WjGdmZE+Q1WGmZWM26VXkeqQ7S0isJg/ygOmkgvA YtM2+LfeMIZ04jq+0wa1Y+NfVzTmOodbDiCyz7vHBNZcIj1sflLtx1hTnZCaRyXWkk N36rmdWooKQ7pwstcwHV72OvV5EaiENa+tLgRg+GDiuFYZxHkmeZqEOD34vnB3a3Y5 KMNiek1wlEwqg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bartosz Golaszewski , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.8 307/715] Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional() Date: Sun, 24 Mar 2024 18:28:06 -0400 Message-ID: <20240324223455.1342824-308-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: Bartosz Golaszewski [ Upstream commit 56d074d26c5828773b00b2185dd7e1d08273b8e8 ] The optional variants for the gpiod_get() family of functions return NULL if the GPIO in question is not associated with this device. They return ERR_PTR() on any other error. NULL descriptors are graciously handled by GPIOLIB and can be safely passed to any of the GPIO consumer interfaces as they will return 0 and act as if the function succeeded. If one is using the optional variant, then there's no point in checking for NULL. Fixes: 6845667146a2 ("Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe") Signed-off-by: Bartosz Golaszewski Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_qca.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index edd2a81b4d5ed..8a60ad7acd705 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2326,7 +2326,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR_OR_NULL(qcadev->bt_en) && + if (IS_ERR(qcadev->bt_en) && (data->soc_type == QCA_WCN6750 || data->soc_type == QCA_WCN6855)) { dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n"); @@ -2335,7 +2335,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl", GPIOD_IN); - if (IS_ERR_OR_NULL(qcadev->sw_ctrl) && + if (IS_ERR(qcadev->sw_ctrl) && (data->soc_type == QCA_WCN6750 || data->soc_type == QCA_WCN6855 || data->soc_type == QCA_WCN7850)) @@ -2357,7 +2357,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) default: qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR_OR_NULL(qcadev->bt_en)) { + if (IS_ERR(qcadev->bt_en)) { dev_warn(&serdev->dev, "failed to acquire enable gpio\n"); power_ctrl_enabled = false; } -- 2.43.0