Thread (2 messages) 2 messages, 2 authors, 2018-02-26

Re: [PATCH] gpiolib: Keep returning EPROBE_DEFER when we should

From: Maxime Ripard <hidden>
Date: 2018-02-26 13:05:43
Also in: lkml
Subsystem: gpio subsystem, the rest · Maintainers: Linus Walleij, Bartosz Golaszewski, Linus Torvalds

On Mon, Feb 26, 2018 at 11:24:35AM +0100, Linus Walleij wrote:
On Wed, Feb 21, 2018 at 10:16 AM, Maxime Ripard
[off-list ref] wrote:
quoted
On Wed, Feb 21, 2018 at 09:17:15AM +0100, Linus Walleij wrote:
quoted
On Wed, Feb 21, 2018 at 9:11 AM, Maxime Ripard
[off-list ref] wrote:
This is slightly embarrassing, but that patch doesn't actually fix
anything. I tried to be smart and rework it to look nicer, and
obviously failed.

Can you squash
http://code.bulix.org/z1vkt1-286673

in the commit?
This site is down.
Sorry :/
Can you send a new version of the patch or just reply with the
change inline here?
Here it is:

---------8<----------------
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index c92847ff5d0a..ae70f679459c 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -241,8 +241,6 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
 
                desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx,
                                                &of_flags);
-               if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
-                       break;
 
                /*
                 * -EPROBE_DEFER in our case means that we found a
@@ -256,6 +254,9 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
                 */
                if (IS_ERR(desc) && PTR_ERR(desc) == -EPROBE_DEFER)
                        return desc;
+
+               if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
+                       break;
        }
 
        /* Special handling for SPI GPIOs if used */
----------8<-----------------
-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help