mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-17 19:05:29 +08:00
26 lines
983 B
Diff
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;
|
||
|
}
|