[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240509104605.538274-1-laura.nao@collabora.com>
Date: Thu, 9 May 2024 12:46:05 +0200
From: Laura Nao <laura.nao@...labora.com>
To: mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com
Cc: linus.walleij@...aro.org,
brgl@...ev.pl,
kernel@...labora.com,
linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org,
linux-acpi@...r.kernel.org,
Laura Nao <laura.nao@...labora.com>,
"kernelci.org bot" <bot@...nelci.org>
Subject: [PATCH] gpiolib: acpi: Add ACPI device NULL check to acpi_can_fallback_to_crs()
Check ACPI device for NULL inside acpi_can_fallback_to_crs(), so callers
won't need to.
Signed-off-by: Laura Nao <laura.nao@...labora.com>
Reported-by: "kernelci.org bot" <bot@...nelci.org>
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
Powered by blists - more mailing lists