Skip to content

More precise error reporting for of_get_named_gpio

Alexandre Courbot linux-devicetree lkml 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2of: return -ENOENT when no propertydrivers/of/base.c+1 -12 replies
2/2gpio: propagate of_parse_phandle_with_args errorsdrivers/gpio/gpiolib-of.c+1 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] More precise error reporting for of_get_named_gpio

of_get_named_gpio is a very convenient way to get a GPIO from a device tree. However it makes no difference between an invalid property or the absence of it and returns -EINVAL in both cases.

Sometimes a GPIO property can be optional, and so far we need to use a separate call to e.g. of_get_property. These two patches make it possible to differenciate both cases by having of_parse_phandle_with_args return -ENOENT instead of -EINVAL if the requested property does not exist, and of_get_named_gpio_flags propage the return value of of_parse_phandle_with_args instead of invariably returning -EINVAL/

Alexandre Courbot (2):
of: return -ENOENT when no property
gpio: propagate of_parse_phandle_with_args errors

 drivers/gpio/gpiolib-of.c | 2 +-
 drivers/of/base.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.11.1