lede/target/linux/bcm27xx/patches-6.12/950-0814-spi-rp2040-gpio-bridge-fix-gpiod-error-handling.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

26 lines
983 B
Diff

From 121c4df03b3039245470e62e04bbd1f433de8aee Mon Sep 17 00:00:00 2001
From: Richard Oliver <richard.oliver@raspberrypi.com>
Date: Tue, 25 Feb 2025 15:22:46 +0000
Subject: [PATCH] spi: rp2040-gpio-bridge: fix gpiod error handling
In some circumstances, devm_gpiod_get_array_optional() can return
PTR_ERR rather than NULL to indicate failure. Handle these cases.
Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
---
drivers/spi/spi-rp2040-gpio-bridge.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/spi/spi-rp2040-gpio-bridge.c
+++ b/drivers/spi/spi-rp2040-gpio-bridge.c
@@ -956,7 +956,8 @@ static void rp2040_gbdg_parse_dt(struct
rp2040_gbdg->fast_xfer_gpios =
devm_gpiod_get_array_optional(dev, "fast_xfer", GPIOD_ASIS);
- if (!rp2040_gbdg->fast_xfer_gpios) {
+ if (IS_ERR_OR_NULL(rp2040_gbdg->fast_xfer_gpios)) {
+ rp2040_gbdg->fast_xfer_gpios = NULL;
dev_info(dev, "Could not acquire fast_xfer-gpios\n");
goto node_put;
}