Skip to contentSkip to conversation

gpio: of: fix Freescale SPI CS quirk handling

PATCH In review Andreas Kemnade 2 participants 2 messages Aug 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: of: fix Freescale SPI CS quirk handling

On the gta04 we see:
spi_gpio: probe of spi_lcd failed with error -2

The quirk introduced in
commit e3023bf80639 ("gpio: of: Handle the Freescale SPI CS") can also be triggered by a temporary -EPROBE_DEFER and so "convert" it to a hard -ENOENT.

Disable that conversion by checking for -EPROBE_DEFER.

Fixes e3023bf80639 ("gpio: of: Handle the Freescale SPI CS")
---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib-of.c +1 -1
index 567fb98c0892..9762dd6d99fa 100644
@@ -363,7 +363,7 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
 	/* Special handling for SPI GPIOs if used */
 	if (IS_ERR(desc))
 		desc = of_find_spi_gpio(dev, con_id, &of_flags);
-	if (IS_ERR(desc)) {
+	if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) {
 		/* This quirk looks up flags and all */
 		desc = of_find_spi_cs_gpio(dev, con_id, idx, flags);
 		if (!IS_ERR(desc))
Signature · 1 line
2.20.1
#1 lore raw
Quoted 8 lines · Andreas Kemnade

On the gta04 we see:
spi_gpio: probe of spi_lcd failed with error -2

The quirk introduced in
commit e3023bf80639 ("gpio: of: Handle the Freescale SPI CS") can also be triggered by a temporary -EPROBE_DEFER and so "convert" it to a hard -ENOENT.

Quoted 5 lines

Disable that conversion by checking for -EPROBE_DEFER.

Fixes e3023bf80639 ("gpio: of: Handle the Freescale SPI CS")

Good catch! Patch applied for fixes.

Yours,
Linus Walleij