gpiolib: Clean up headers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 7 Oct 2022 09:53:44 +0000 (12:53 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 24 Oct 2022 09:30:26 +0000 (12:30 +0300)
There is a few things done:
- include only the headers we are direct user of
- when pointer is in use, provide a forward declaration
- add missing headers
- group generic headers and subsystem headers
- sort each group alphabetically

While at it, fix some awkward indentations.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpiolib-acpi.h
drivers/gpio/gpiolib-of.h
drivers/gpio/gpiolib-sysfs.h
include/linux/gpio.h
include/linux/gpio/driver.h
include/linux/gpio/machine.h

index 1ac6816839dbce7544843dcaa2b47e5826f041c8..01e0cb480a00cfba13c9a80fcbcbf36bd6316e4e 100644 (file)
@@ -8,7 +8,19 @@
 #ifndef GPIOLIB_ACPI_H
 #define GPIOLIB_ACPI_H
 
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#include <linux/gpio/consumer.h>
+
 struct acpi_device;
+struct device;
+struct fwnode_handle;
+
+struct gpio_chip;
+struct gpio_desc;
+struct gpio_device;
 
 /**
  * struct acpi_gpio_info - ACPI GPIO specific information
index 8af2bc899aab251082f11441beb1618183a4b1d4..1b5df39a952e0753c865eee823cc4944b6a223fe 100644 (file)
@@ -3,8 +3,17 @@
 #ifndef GPIOLIB_OF_H
 #define GPIOLIB_OF_H
 
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#include <linux/notifier.h>
+
+struct device;
+
 struct gpio_chip;
-enum of_gpio_flags;
+struct gpio_desc;
+struct gpio_device;
 
 #ifdef CONFIG_OF_GPIO
 struct gpio_desc *of_find_gpio(struct device *dev,
index ddd0e503f8eb97619bdb9f556aded129bbcfb6b1..0f213bdb4732464c4f60ba59fe44c634013f7589 100644 (file)
@@ -5,6 +5,8 @@
 
 #ifdef CONFIG_GPIO_SYSFS
 
+struct gpio_device;
+
 int gpiochip_sysfs_register(struct gpio_device *gdev);
 void gpiochip_sysfs_unregister(struct gpio_device *gdev);
 
index a370387fa40680b7d22ee57ac3caf681993175c8..346f60bbab3027464a6567e6be312c68c98cdaa5 100644 (file)
@@ -98,9 +98,9 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio,
 
 #else /* ! CONFIG_GPIOLIB */
 
+#include <linux/bug.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <linux/bug.h>
 
 struct device;
 struct gpio_chip;
index 6aeea1071b1b2d69643e4ff5dbc82b9f41df1189..2a44600b01f76a1cfac91e9ca1060e850157506b 100644 (file)
@@ -7,8 +7,8 @@
 #include <linux/irqchip/chained_irq.h>
 #include <linux/irqdomain.h>
 #include <linux/lockdep.h>
-#include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinconf-generic.h>
+#include <linux/pinctrl/pinctrl.h>
 #include <linux/property.h>
 #include <linux/types.h>
 
index 0b619eb7ae83be5cfce0c1927504d9c55d992130..44e5f162973eb6f6e85188f56ec34e1e3e2beab6 100644 (file)
@@ -3,7 +3,6 @@
 #define __LINUX_GPIO_MACHINE_H
 
 #include <linux/types.h>
-#include <linux/list.h>
 
 enum gpio_lookup_flags {
        GPIO_ACTIVE_HIGH                = (0 << 0),