]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: return -ENOENT if no GPIO mapping exists
authorAlexandre Courbot <acourbot@nvidia.com>
Wed, 11 Dec 2013 02:32:28 +0000 (11:32 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 12 Dec 2013 18:33:59 +0000 (19:33 +0100)
commit774ea2123205412aa7c8aaff1797eac412ab5c9a
tree67bb549dbb30bf8a0a40395176aac02466a25c23
parent571df2c393b7a4577d2ab786f667e2bf4a5f0261
gpiolib: return -ENOENT if no GPIO mapping exists

Some devices drivers make use of optional GPIO parameters. For such
drivers, it is important to discriminate between the case where no
GPIO mapping has been defined for the function they are requesting, and
the case where a mapping exists but an error occured while resolving it
or when acquiring the GPIO.

This patch changes the family of gpiod_get() functions such that they
will return -ENOENT if and only if no GPIO mapping is defined for the
requested function. Other error codes are used when an actual error
occured during the GPIO resolution.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/gpio/consumer.txt
drivers/gpio/gpiolib.c