gpiolib: Clean up headers

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Andy Shevchenko
2023-02-08 19:07:28 +02:00
parent 5b1911976c
commit 380c7ba392
10 changed files with 75 additions and 38 deletions

View File

@@ -12,9 +12,10 @@
#ifndef __LINUX_GPIO_H
#define __LINUX_GPIO_H
#include <linux/errno.h>
#include <linux/types.h>
struct device;
/* see Documentation/driver-api/gpio/legacy.rst */
/* make these flag values available regardless of GPIO kconfig options */
@@ -134,19 +135,16 @@ void gpio_free_array(const struct gpio *array, size_t num);
/* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */
struct device;
int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
int devm_gpio_request_one(struct device *dev, unsigned gpio,
unsigned long flags, const char *label);
#else /* ! CONFIG_GPIOLIB */
#include <linux/bug.h>
#include <linux/kernel.h>
struct device;
struct gpio_chip;
#include <asm/bug.h>
#include <asm/errno.h>
static inline bool gpio_is_valid(int number)
{