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>
This commit is contained in:
parent
a1000673d2
commit
f310f2eff7
|
@ -161,7 +161,7 @@ struct gpio_irq_chip {
|
||||||
*/
|
*/
|
||||||
void (*irq_disable)(struct irq_data *data);
|
void (*irq_disable)(struct irq_data *data);
|
||||||
};
|
};
|
||||||
#endif
|
#endif /* CONFIG_GPIOLIB_IRQCHIP */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct gpio_chip - abstract a GPIO controller
|
* struct gpio_chip - abstract a GPIO controller
|
||||||
|
@ -301,7 +301,7 @@ struct gpio_chip {
|
||||||
spinlock_t bgpio_lock;
|
spinlock_t bgpio_lock;
|
||||||
unsigned long bgpio_data;
|
unsigned long bgpio_data;
|
||||||
unsigned long bgpio_dir;
|
unsigned long bgpio_dir;
|
||||||
#endif
|
#endif /* CONFIG_GPIO_GENERIC */
|
||||||
|
|
||||||
#ifdef CONFIG_GPIOLIB_IRQCHIP
|
#ifdef CONFIG_GPIOLIB_IRQCHIP
|
||||||
/*
|
/*
|
||||||
|
@ -316,7 +316,7 @@ struct gpio_chip {
|
||||||
* used to handle IRQs for most practical cases.
|
* used to handle IRQs for most practical cases.
|
||||||
*/
|
*/
|
||||||
struct gpio_irq_chip irq;
|
struct gpio_irq_chip irq;
|
||||||
#endif
|
#endif /* CONFIG_GPIOLIB_IRQCHIP */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @need_valid_mask:
|
* @need_valid_mask:
|
||||||
|
@ -363,7 +363,7 @@ struct gpio_chip {
|
||||||
*/
|
*/
|
||||||
int (*of_xlate)(struct gpio_chip *gc,
|
int (*of_xlate)(struct gpio_chip *gc,
|
||||||
const struct of_phandle_args *gpiospec, u32 *flags);
|
const struct of_phandle_args *gpiospec, u32 *flags);
|
||||||
#endif
|
#endif /* CONFIG_OF_GPIO */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const char *gpiochip_is_requested(struct gpio_chip *chip,
|
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,
|
||||||
})
|
})
|
||||||
#else
|
#else
|
||||||
#define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL)
|
#define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL)
|
||||||
#endif
|
#endif /* CONFIG_LOCKDEP */
|
||||||
|
|
||||||
static inline int gpiochip_add(struct gpio_chip *chip)
|
static inline int gpiochip_add(struct gpio_chip *chip)
|
||||||
{
|
{
|
||||||
|
@ -461,7 +461,7 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev,
|
||||||
#define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */
|
#define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */
|
||||||
#define BGPIOF_NO_OUTPUT BIT(5) /* only input */
|
#define BGPIOF_NO_OUTPUT BIT(5) /* only input */
|
||||||
|
|
||||||
#endif
|
#endif /* CONFIG_GPIO_GENERIC */
|
||||||
|
|
||||||
#ifdef CONFIG_GPIOLIB_IRQCHIP
|
#ifdef CONFIG_GPIOLIB_IRQCHIP
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip,
|
||||||
handler, type, true,
|
handler, type, true,
|
||||||
&lock_key, &request_key);
|
&lock_key, &request_key);
|
||||||
}
|
}
|
||||||
#else
|
#else /* ! CONFIG_LOCKDEP */
|
||||||
static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
|
static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
|
||||||
struct irq_chip *irqchip,
|
struct irq_chip *irqchip,
|
||||||
unsigned int first_irq,
|
unsigned int first_irq,
|
||||||
|
@ -582,7 +582,7 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip,
|
||||||
unsigned int gpio_offset, const char *pin_group);
|
unsigned int gpio_offset, const char *pin_group);
|
||||||
void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
|
void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
|
||||||
|
|
||||||
#else
|
#else /* ! CONFIG_PINCTRL */
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
|
gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
|
||||||
|
|
|
@ -11,4 +11,4 @@ struct gpio_chip *gpio_reg_init(struct device *dev, void __iomem *reg,
|
||||||
|
|
||||||
int gpio_reg_resume(struct gpio_chip *gc);
|
int gpio_reg_resume(struct gpio_chip *gc);
|
||||||
|
|
||||||
#endif
|
#endif /* GPIO_REG_H */
|
||||||
|
|
|
@ -97,7 +97,7 @@ void gpiod_add_lookup_table(struct gpiod_lookup_table *table);
|
||||||
void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n);
|
void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n);
|
||||||
void gpiod_remove_lookup_table(struct gpiod_lookup_table *table);
|
void gpiod_remove_lookup_table(struct gpiod_lookup_table *table);
|
||||||
void gpiod_add_hogs(struct gpiod_hog *hogs);
|
void gpiod_add_hogs(struct gpiod_hog *hogs);
|
||||||
#else
|
#else /* ! CONFIG_GPIOLIB */
|
||||||
static inline
|
static inline
|
||||||
void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {}
|
void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {}
|
||||||
static inline
|
static inline
|
||||||
|
@ -105,6 +105,6 @@ void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n) {}
|
||||||
static inline
|
static inline
|
||||||
void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {}
|
void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {}
|
||||||
static inline void gpiod_add_hogs(struct gpiod_hog *hogs) {}
|
static inline void gpiod_add_hogs(struct gpiod_hog *hogs) {}
|
||||||
#endif
|
#endif /* CONFIG_GPIOLIB */
|
||||||
|
|
||||||
#endif /* __LINUX_GPIO_MACHINE_H */
|
#endif /* __LINUX_GPIO_MACHINE_H */
|
||||||
|
|
Loading…
Reference in New Issue