Skip to content

Commit 0683c97

Browse files
roliver-rpipopcornmix
authored andcommitted
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 <[email protected]>
1 parent 3ad40f1 commit 0683c97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi-rp2040-gpio-bridge.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,8 @@ static void rp2040_gbdg_parse_dt(struct rp2040_gbdg *rp2040_gbdg)
956956

957957
rp2040_gbdg->fast_xfer_gpios =
958958
devm_gpiod_get_array_optional(dev, "fast_xfer", GPIOD_ASIS);
959-
if (!rp2040_gbdg->fast_xfer_gpios) {
959+
if (IS_ERR_OR_NULL(rp2040_gbdg->fast_xfer_gpios)) {
960+
rp2040_gbdg->fast_xfer_gpios = NULL;
960961
dev_info(dev, "Could not acquire fast_xfer-gpios\n");
961962
goto node_put;
962963
}

0 commit comments

Comments
 (0)