aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-of.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-09-15 08:17:27 -0400
committerDavid S. Miller <davem@davemloft.net>2019-09-15 08:17:27 -0400
commitaa2eaa8c272a3211dec07ce9c6c863a7e355c10e (patch)
tree8454a23d36b2ff36133c276ee0ba80eabc00850e /drivers/gpio/gpiolib-of.c
parenta3d3c74da49c65fc63a937fa559186b0e16adca3 (diff)
parent1609d7604b847a9820e63393d1a3b6cac7286d40 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Minor overlapping changes in the btusb and ixgbe drivers. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r--drivers/gpio/gpiolib-of.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 9762dd6d99fa..9b44c49a9227 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -343,36 +343,27 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
343 343
344 desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx, 344 desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx,
345 &of_flags); 345 &of_flags);
346 /*
347 * -EPROBE_DEFER in our case means that we found a
348 * valid GPIO property, but no controller has been
349 * registered so far.
350 *
351 * This means we don't need to look any further for
352 * alternate name conventions, and we should really
353 * preserve the return code for our user to be able to
354 * retry probing later.
355 */
356 if (IS_ERR(desc) && PTR_ERR(desc) == -EPROBE_DEFER)
357 return desc;
358 346
359 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) 347 if (!IS_ERR(desc) || PTR_ERR(desc) != -ENOENT)
360 break; 348 break;
361 } 349 }
362 350
363 /* Special handling for SPI GPIOs if used */ 351 if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) {
364 if (IS_ERR(desc)) 352 /* Special handling for SPI GPIOs if used */
365 desc = of_find_spi_gpio(dev, con_id, &of_flags); 353 desc = of_find_spi_gpio(dev, con_id, &of_flags);
366 if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) { 354 }
355
356 if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) {
367 /* This quirk looks up flags and all */ 357 /* This quirk looks up flags and all */
368 desc = of_find_spi_cs_gpio(dev, con_id, idx, flags); 358 desc = of_find_spi_cs_gpio(dev, con_id, idx, flags);
369 if (!IS_ERR(desc)) 359 if (!IS_ERR(desc))
370 return desc; 360 return desc;
371 } 361 }
372 362
373 /* Special handling for regulator GPIOs if used */ 363 if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT) {
374 if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) 364 /* Special handling for regulator GPIOs if used */
375 desc = of_find_regulator_gpio(dev, con_id, &of_flags); 365 desc = of_find_regulator_gpio(dev, con_id, &of_flags);
366 }
376 367
377 if (IS_ERR(desc)) 368 if (IS_ERR(desc))
378 return desc; 369 return desc;