aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2015-01-07 03:44:57 -0500
committerLinus Walleij <linus.walleij@linaro.org>2015-01-15 11:23:22 -0500
commitd34541bc48eb7d7cb2ead5ff0284acf65af96f17 (patch)
treee960329aee7dd8a903d88db61bb488a75c6a9050
parentffe4770b9b3483f74bccd0566fd1013ddc1b6d6b (diff)
gpio: Make the vararg hacks not pass magic values
Right now, in consumer.h, there's some vararg hacks that pass 0 as the flags. What actually is passed however is GPIOD_ASIS, which naturally is also 0. Using the define/enum rather then the magic 0 makes it the define more readable to a passer by. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--include/linux/gpio/consumer.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index fd85cb120ee0..45afc2dee560 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -340,31 +340,32 @@ static inline int desc_to_gpio(const struct gpio_desc *desc)
340 * etc. 340 * etc.
341 */ 341 */
342#define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags) 342#define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags)
343#define gpiod_get(varargs...) __gpiod_get(varargs, 0) 343#define gpiod_get(varargs...) __gpiod_get(varargs, GPIOD_ASIS)
344#define __gpiod_get_index(dev, con_id, index, flags, ...) \ 344#define __gpiod_get_index(dev, con_id, index, flags, ...) \
345 __gpiod_get_index(dev, con_id, index, flags) 345 __gpiod_get_index(dev, con_id, index, flags)
346#define gpiod_get_index(varargs...) __gpiod_get_index(varargs, 0) 346#define gpiod_get_index(varargs...) __gpiod_get_index(varargs, GPIOD_ASIS)
347#define __gpiod_get_optional(dev, con_id, flags, ...) \ 347#define __gpiod_get_optional(dev, con_id, flags, ...) \
348 __gpiod_get_optional(dev, con_id, flags) 348 __gpiod_get_optional(dev, con_id, flags)
349#define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, 0) 349#define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, GPIOD_ASIS)
350#define __gpiod_get_index_optional(dev, con_id, index, flags, ...) \ 350#define __gpiod_get_index_optional(dev, con_id, index, flags, ...) \
351 __gpiod_get_index_optional(dev, con_id, index, flags) 351 __gpiod_get_index_optional(dev, con_id, index, flags)
352#define gpiod_get_index_optional(varargs...) \ 352#define gpiod_get_index_optional(varargs...) \
353 __gpiod_get_index_optional(varargs, 0) 353 __gpiod_get_index_optional(varargs, GPIOD_ASIS)
354#define __devm_gpiod_get(dev, con_id, flags, ...) \ 354#define __devm_gpiod_get(dev, con_id, flags, ...) \
355 __devm_gpiod_get(dev, con_id, flags) 355 __devm_gpiod_get(dev, con_id, flags)
356#define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, 0) 356#define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, GPIOD_ASIS)
357#define __devm_gpiod_get_index(dev, con_id, index, flags, ...) \ 357#define __devm_gpiod_get_index(dev, con_id, index, flags, ...) \
358 __devm_gpiod_get_index(dev, con_id, index, flags) 358 __devm_gpiod_get_index(dev, con_id, index, flags)
359#define devm_gpiod_get_index(varargs...) __devm_gpiod_get_index(varargs, 0) 359#define devm_gpiod_get_index(varargs...) \
360 __devm_gpiod_get_index(varargs, GPIOD_ASIS)
360#define __devm_gpiod_get_optional(dev, con_id, flags, ...) \ 361#define __devm_gpiod_get_optional(dev, con_id, flags, ...) \
361 __devm_gpiod_get_optional(dev, con_id, flags) 362 __devm_gpiod_get_optional(dev, con_id, flags)
362#define devm_gpiod_get_optional(varargs...) \ 363#define devm_gpiod_get_optional(varargs...) \
363 __devm_gpiod_get_optional(varargs, 0) 364 __devm_gpiod_get_optional(varargs, GPIOD_ASIS)
364#define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...) \ 365#define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...) \
365 __devm_gpiod_get_index_optional(dev, con_id, index, flags) 366 __devm_gpiod_get_index_optional(dev, con_id, index, flags)
366#define devm_gpiod_get_index_optional(varargs...) \ 367#define devm_gpiod_get_index_optional(varargs...) \
367 __devm_gpiod_get_index_optional(varargs, 0) 368 __devm_gpiod_get_index_optional(varargs, GPIOD_ASIS)
368 369
369#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) 370#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
370 371