lede/target/linux/bcm27xx/patches-6.6/950-1545-spi-rp2040-gpio-bridge-fix-gpiod-error-handling.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= 975ce33610 bcm27xx: pull 6.6 patches from RPi
Adds latest 6.6 patches from the Raspberry Pi repository.

These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.6.y/

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-04-29 23:01:01 +08:00

26 lines
983 B
Diff

From f8f3e202fb083906fbc98ef6ea445e424779c076 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;
}