Skip to content

Commit 007094c

Browse files
author
Bartosz Golaszewski
committed
gpiolib: use the required minimum set of headers
Andy suggested we should keep a fine-grained scheme for includes and only pull in stuff required within individual ifdef sections. Let's revert commit dea69f2 ("gpiolib: move all includes to the top of gpio/consumer.h") and make the headers situation even more fine-grained by only including the first level headers containing requireded symbols except for bug.h where checkpatch.pl warns against including asm/bug.h. Fixes: dea69f2 ("gpiolib: move all includes to the top of gpio/consumer.h") Suggested-by: Andy Shevchenko <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent da5dd31 commit 007094c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/linux/gpio/consumer.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
#define __LINUX_GPIO_CONSUMER_H
44

55
#include <linux/bits.h>
6-
#include <linux/bug.h>
76
#include <linux/err.h>
8-
#include <linux/errno.h>
9-
#include <linux/kernel.h>
107
#include <linux/types.h>
118

129
struct acpi_device;
@@ -185,6 +182,9 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
185182

186183
#else /* CONFIG_GPIOLIB */
187184

185+
#include <linux/bug.h>
186+
#include <linux/kernel.h>
187+
188188
static inline int gpiod_count(struct device *dev, const char *con_id)
189189
{
190190
return 0;
@@ -549,6 +549,9 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
549549
int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
550550
int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
551551
#else
552+
553+
#include <linux/bug.h>
554+
552555
static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
553556
unsigned long flags)
554557
{

0 commit comments

Comments
 (0)