lkml.org 
[lkml]   [2018]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] gpiolib: Keep returning EPROBE_DEFER when we should
On Mon, Feb 26, 2018 at 11:24:35AM +0100, Linus Walleij wrote:
> On Wed, Feb 21, 2018 at 10:16 AM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Wed, Feb 21, 2018 at 09:17:15AM +0100, Linus Walleij wrote:
> >> On Wed, Feb 21, 2018 at 9:11 AM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> 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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-02-26 14:05    [W:0.038 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site