Files
kernel_arpi/include/linux
Thierry Reding 29a1f2333e gpio: Add helpers for optional GPIOs
Introduce gpiod_get_optional() and gpiod_get_index_optional() helpers
that make it easier for drivers to handle optional GPIOs.

Currently in order to handle optional GPIOs, a driver needs to special
case error handling for -ENOENT, such as this:

	gpio = gpiod_get(dev, "foo");
	if (IS_ERR(gpio)) {
		if (PTR_ERR(gpio) != -ENOENT)
			return PTR_ERR(gpio);

		gpio = NULL;
	}

	if (gpio) {
		/* set up GPIO */
	}

With these new helpers the above is reduced to:

	gpio = gpiod_get_optional(dev, "foo");
	if (IS_ERR(gpio))
		return PTR_ERR(gpio);

	if (gpio) {
		/* set up GPIO */
	}

While at it, device-managed variants of these functions are also
provided.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-05-09 13:48:30 +02:00
..
2014-05-09 13:48:30 +02:00
2014-03-28 16:29:35 -04:00
2014-04-18 16:40:08 -07:00
2014-03-11 11:52:47 +01:00
2014-04-03 16:20:58 -07:00
2014-04-01 17:08:43 +02:00
2014-04-01 23:19:14 -04:00
2014-03-10 11:44:42 -04:00
2014-03-11 22:52:43 -04:00
2014-03-10 17:26:19 -07:00
2014-02-20 14:54:28 +01:00
2014-03-04 07:55:47 -08:00
2014-04-07 16:36:07 -07:00
2014-03-07 11:41:32 -05:00
2014-04-17 12:30:40 -07:00
2014-03-13 12:11:00 +10:30
2014-04-03 16:20:50 -07:00
2014-02-28 15:36:37 -08:00
2014-04-01 23:19:08 -04:00
2014-03-04 13:51:06 -05:00
2014-04-01 23:19:10 -04:00
2014-03-17 15:14:16 -04:00
2014-03-17 15:15:21 -04:00
2014-04-07 10:59:19 -07:00
2014-04-03 16:21:04 -07:00
2014-03-19 15:11:19 -06:00
2014-03-19 22:24:08 -04:00
2014-03-09 19:53:45 +01:00
2014-04-01 17:08:43 +02:00
2014-04-07 16:35:53 -07:00