Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1060973lqo; Thu, 9 May 2024 03:46:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkR1+wkSZJ00JW7M5BlnbHO4MzRwDgaN9AhLIUSGxHQfmywBDsdVIK1x3Y3/UvnFPC8P3jVb9TxyryHbbjg8ycrS2JQ/wDnfBVUwFeRw== X-Google-Smtp-Source: AGHT+IHUHUQTV+y6CyAQsFdm+wzQNTZeMmhV5rQq/bfJOViYgpLpqRzecGU1jPUvH6V8kes6nnQB X-Received: by 2002:a17:902:f792:b0:1eb:5403:b16 with SMTP id d9443c01a7336-1eeaf87bed2mr68142215ad.0.1715251570567; Thu, 09 May 2024 03:46:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715251570; cv=pass; d=google.com; s=arc-20160816; b=hTXE9hjcHCgNsCWlLFedIyMhBFJ5Ebh+L0KvL2ZLyQ5sMGy/P861YB+DEPAGg7GgIB g5pCdgEMbfuXrH8rrQXaEL9d/NeRFhC2f6Y0j3FWKlDPr5iJZBp8RsC+XfqOftO6O9fO DWeac5hVJidxLHWp5JBflnQ1vBEmmBUVlVhhtMoiXAudPv7YTTQUcUgAid51/DK5CTqu 1HTBAD8CF0PEIgt1UdkeTrVXWv8mCawzfWq/0wCiUHkdPgd/eIZeX6+xvS55ItpXJFgM kJMGcv67jNgfcMmrjVxF/Yq3taJXxXQt0VxfMgznx6Cy8M5zWG/xxxKGbCKw9S22N02d /NKw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=4Tz/lTwquEBh6errqpIdGh7gRfBSnP6SbaQCASGKw2w=; fh=am4BKVp3pGJDaLxQaZdrncS7JQJnrQ4+bM+NTlMiuck=; b=kkOKhQhYE0hwuYBo+aXksqSBrqDjA/JZzGHC3A2pa9IHq+YEFNrT08VwRFcgfRskYY eiLeGSJrzDCtio3gZJBv/3UC/nBa8UpTrriu6lGC0+J1idPOl3puFGt4e7sztkEOSGpd Xyx4aTJwY+JF6mR8NBYxX2GvgoI8GuPMSzIOImMojNvW8ep8MiYgW5Wa5pfFTdB3RLVm 73Pes9AH7cLW48x8ufdMOoEcC+RKewJTw7m91znadLpKWkDL6S7cxhVbOpF1t4kkVEoC 7vKDaQBHa7Ee4JZKDV//rkJA74x1CaKl0taGKDV7sBhKA2V/co2T7WC2KDCKV9a9jEiy 7yVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=spXqQJwz; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-174409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174409-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9cf903si11649655ad.110.2024.05.09.03.46.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174409-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=@collabora.com header.s=mail header.b=spXqQJwz; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-174409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174409-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 E862CB2255A for ; Thu, 9 May 2024 10:45:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 126CE12F5B8; Thu, 9 May 2024 10:45:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="spXqQJwz" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 C19B0322E; Thu, 9 May 2024 10:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715251541; cv=none; b=OGlYIp3pJffy0s2OMmrjDOK2r3Ii0Bb+LiH5M+FtSWTgiofXNalLhrSAhml0h5a65R0H2IRpciblF/3GXsrsJPt0oSlMP7/U99DvMG4tHqkUvMyfE4SLIWfOCxaRkKqsdCtwu5G+07J96RVZV3UbvM1D9zwUKDVOP2PQapjDU4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715251541; c=relaxed/simple; bh=H4jv+yatmvGeN/CSJq1fPbVdsYylD8RmnOWtmlUY5/0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PRJAd2A7j9Y7BD7jpPBNkvOuFK645yFCG+iMUwIAjnMi2ZAza5MomdL7CYAYfw5rKyDmcjSYt8T0ImbyGGyuN62L741DqpvEatYYyNubsl+NJGh5h1MlLmbYbWfDZVtqaGl6MttY1ivdJltZW2eA8aEs5v51+y5T50ubIgUv8jc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=spXqQJwz; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1715251538; bh=H4jv+yatmvGeN/CSJq1fPbVdsYylD8RmnOWtmlUY5/0=; h=From:To:Cc:Subject:Date:From; b=spXqQJwzPgT6PKGfRZ3JPDwsnYZrDTc2M/mgjBPLt9aU10aNYgviYt+22AqKaqmQD F+YAeNAtbQ0AEP0dJXjENg9gTg2fkvwetFU4/EcB5mjR4m6Ia1ges/k8vTlbatKk7o HY9MYC2xMoVrWzgqzVn65qgxuDpHRQuyzk5CDSvyBU7O/uOcyLOk2D9yHrR6dTMnFL DfiZrcrGgcvgUc/MIiyeqYF8IiF8XL87ZoR83RtWKafnr5eid154IGOEZ8pXmydFr3 WFEhKdr4H+/PyGf1qBeBljiTpwjXCMcfGSK9N7iwZEedF3Pafz3XBt1RsyXQ+BWdli P6k4I6WjEvV7Q== Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: laura.nao) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6F56B3782172; Thu, 9 May 2024 10:45:37 +0000 (UTC) From: Laura Nao To: mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linus.walleij@linaro.org, brgl@bgdev.pl, kernel@collabora.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, Laura Nao , "kernelci.org bot" Subject: [PATCH] gpiolib: acpi: Add ACPI device NULL check to acpi_can_fallback_to_crs() Date: Thu, 9 May 2024 12:46:05 +0200 Message-Id: <20240509104605.538274-1-laura.nao@collabora.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Check ACPI device for NULL inside acpi_can_fallback_to_crs(), so callers won't need to. Signed-off-by: Laura Nao Reported-by: "kernelci.org bot" Closes: https://lore.kernel.org/all/20240426154208.81894-1-laura.nao@collabora.com/ Fixes: 49c02f6e901c ("gpiolib: acpi: Move acpi_can_fallback_to_crs() out of __acpi_find_gpio()") --- drivers/gpio/gpiolib-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 553a5f94c00a..688aff6e51bc 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -939,7 +939,7 @@ static bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id) { /* Never allow fallback if the device has properties */ - if (acpi_dev_has_props(adev) || adev->driver_gpios) + if (!adev || acpi_dev_has_props(adev) || adev->driver_gpios) return false; return con_id == NULL; -- 2.30.2