diff options
author | Enrico Weigelt <info@metux.net> | 2019-06-17 12:45:05 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-06-27 10:56:50 -0400 |
commit | f310f2eff794f96b4ea87be7f5938e57c34a64f1 (patch) | |
tree | d45894a152f8d27c0c023972ac40d25c4e26cf6b | |
parent | a1000673d288f3bb8bf936b043ef3ed3a4240b0a (diff) |
gpio: Add comments on #if/#else/#endif
Improve readability a bit by commenting #if/#else/#endif statements
with the checked preprocessor symbols.
Signed-off-by: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | include/linux/gpio/driver.h | 16 | ||||
-rw-r--r-- | include/linux/gpio/gpio-reg.h | 2 | ||||
-rw-r--r-- | include/linux/gpio/machine.h | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 02698c0f34ea..5d325fd29d6b 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
@@ -161,7 +161,7 @@ struct gpio_irq_chip { | |||
161 | */ | 161 | */ |
162 | void (*irq_disable)(struct irq_data *data); | 162 | void (*irq_disable)(struct irq_data *data); |
163 | }; | 163 | }; |
164 | #endif | 164 | #endif /* CONFIG_GPIOLIB_IRQCHIP */ |
165 | 165 | ||
166 | /** | 166 | /** |
167 | * struct gpio_chip - abstract a GPIO controller | 167 | * struct gpio_chip - abstract a GPIO controller |
@@ -301,7 +301,7 @@ struct gpio_chip { | |||
301 | spinlock_t bgpio_lock; | 301 | spinlock_t bgpio_lock; |
302 | unsigned long bgpio_data; | 302 | unsigned long bgpio_data; |
303 | unsigned long bgpio_dir; | 303 | unsigned long bgpio_dir; |
304 | #endif | 304 | #endif /* CONFIG_GPIO_GENERIC */ |
305 | 305 | ||
306 | #ifdef CONFIG_GPIOLIB_IRQCHIP | 306 | #ifdef CONFIG_GPIOLIB_IRQCHIP |
307 | /* | 307 | /* |
@@ -316,7 +316,7 @@ struct gpio_chip { | |||
316 | * used to handle IRQs for most practical cases. | 316 | * used to handle IRQs for most practical cases. |
317 | */ | 317 | */ |
318 | struct gpio_irq_chip irq; | 318 | struct gpio_irq_chip irq; |
319 | #endif | 319 | #endif /* CONFIG_GPIOLIB_IRQCHIP */ |
320 | 320 | ||
321 | /** | 321 | /** |
322 | * @need_valid_mask: | 322 | * @need_valid_mask: |
@@ -363,7 +363,7 @@ struct gpio_chip { | |||
363 | */ | 363 | */ |
364 | int (*of_xlate)(struct gpio_chip *gc, | 364 | int (*of_xlate)(struct gpio_chip *gc, |
365 | const struct of_phandle_args *gpiospec, u32 *flags); | 365 | const struct of_phandle_args *gpiospec, u32 *flags); |
366 | #endif | 366 | #endif /* CONFIG_OF_GPIO */ |
367 | }; | 367 | }; |
368 | 368 | ||
369 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | 369 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, |
@@ -406,7 +406,7 @@ extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
406 | }) | 406 | }) |
407 | #else | 407 | #else |
408 | #define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL) | 408 | #define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL) |
409 | #endif | 409 | #endif /* CONFIG_LOCKDEP */ |
410 | 410 | ||
411 | static inline int gpiochip_add(struct gpio_chip *chip) | 411 | static inline int gpiochip_add(struct gpio_chip *chip) |
412 | { | 412 | { |
@@ -461,7 +461,7 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev, | |||
461 | #define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */ | 461 | #define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */ |
462 | #define BGPIOF_NO_OUTPUT BIT(5) /* only input */ | 462 | #define BGPIOF_NO_OUTPUT BIT(5) /* only input */ |
463 | 463 | ||
464 | #endif | 464 | #endif /* CONFIG_GPIO_GENERIC */ |
465 | 465 | ||
466 | #ifdef CONFIG_GPIOLIB_IRQCHIP | 466 | #ifdef CONFIG_GPIOLIB_IRQCHIP |
467 | 467 | ||
@@ -531,7 +531,7 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, | |||
531 | handler, type, true, | 531 | handler, type, true, |
532 | &lock_key, &request_key); | 532 | &lock_key, &request_key); |
533 | } | 533 | } |
534 | #else | 534 | #else /* ! CONFIG_LOCKDEP */ |
535 | static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, | 535 | static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, |
536 | struct irq_chip *irqchip, | 536 | struct irq_chip *irqchip, |
537 | unsigned int first_irq, | 537 | unsigned int first_irq, |
@@ -582,7 +582,7 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip, | |||
582 | unsigned int gpio_offset, const char *pin_group); | 582 | unsigned int gpio_offset, const char *pin_group); |
583 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | 583 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); |
584 | 584 | ||
585 | #else | 585 | #else /* ! CONFIG_PINCTRL */ |
586 | 586 | ||
587 | static inline int | 587 | static inline int |
588 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | 588 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, |
diff --git a/include/linux/gpio/gpio-reg.h b/include/linux/gpio/gpio-reg.h index 5c6efd394cb0..39b888c40b39 100644 --- a/include/linux/gpio/gpio-reg.h +++ b/include/linux/gpio/gpio-reg.h | |||
@@ -11,4 +11,4 @@ struct gpio_chip *gpio_reg_init(struct device *dev, void __iomem *reg, | |||
11 | 11 | ||
12 | int gpio_reg_resume(struct gpio_chip *gc); | 12 | int gpio_reg_resume(struct gpio_chip *gc); |
13 | 13 | ||
14 | #endif | 14 | #endif /* GPIO_REG_H */ |
diff --git a/include/linux/gpio/machine.h b/include/linux/gpio/machine.h index 35f299d1f6a7..1ebe5be05d5f 100644 --- a/include/linux/gpio/machine.h +++ b/include/linux/gpio/machine.h | |||
@@ -97,7 +97,7 @@ void gpiod_add_lookup_table(struct gpiod_lookup_table *table); | |||
97 | void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n); | 97 | void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n); |
98 | void gpiod_remove_lookup_table(struct gpiod_lookup_table *table); | 98 | void gpiod_remove_lookup_table(struct gpiod_lookup_table *table); |
99 | void gpiod_add_hogs(struct gpiod_hog *hogs); | 99 | void gpiod_add_hogs(struct gpiod_hog *hogs); |
100 | #else | 100 | #else /* ! CONFIG_GPIOLIB */ |
101 | static inline | 101 | static inline |
102 | void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {} | 102 | void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {} |
103 | static inline | 103 | static inline |
@@ -105,6 +105,6 @@ void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n) {} | |||
105 | static inline | 105 | static inline |
106 | void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {} | 106 | void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {} |
107 | static inline void gpiod_add_hogs(struct gpiod_hog *hogs) {} | 107 | static inline void gpiod_add_hogs(struct gpiod_hog *hogs) {} |
108 | #endif | 108 | #endif /* CONFIG_GPIOLIB */ |
109 | 109 | ||
110 | #endif /* __LINUX_GPIO_MACHINE_H */ | 110 | #endif /* __LINUX_GPIO_MACHINE_H */ |