Skip to contentSkip to conversation

gpiolib: cleanup for duplicated including

PATCH Applied Wang Jinchao 2 participants 2 messages Dec 18, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpiolib: cleanup for duplicated including

Remove second #include <linux/err.h>.
Remove #include <asm/errno.h>.
As they are guaranteed by the global err.h.

---
V2:
Revise the comment per Andy's suggestion.
V1: https://lore.kernel.org/all/[email protected]/

 include/linux/gpio/driver.h | 3 ---
 1 file changed, 3 deletions(-)
include/linux/gpio/driver.h +0 -3
index 0aed62f0c633..df6857e579a1 100644
@@ -701,7 +701,6 @@ int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
 #else
 
 #include <asm/bug.h>
-#include <asm/errno.h>
 
 static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
 					      struct irq_domain *domain)
@@ -789,8 +788,6 @@ int gpio_device_get_base(struct gpio_device *gdev);
 
 #else /* CONFIG_GPIOLIB */
 
-#include <linux/err.h>
-
 #include <asm/bug.h>
 
 static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
Signature · 1 line
2.40.0
#1 lore raw
Quoted 36 lines · Wang Jinchao

Remove second #include <linux/err.h>.
Remove #include <asm/errno.h>.
As they are guaranteed by the global err.h.

---
V2:
Revise the comment per Andy's suggestion.
V1: https://lore.kernel.org/all/[email protected]/

 include/linux/gpio/driver.h | 3 ---
 1 file changed, 3 deletions(-)
include/linux/gpio/driver.h +0 -4
index 0aed62f0c633..df6857e579a1 100644
@@ -701,7 +701,6 @@ int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
 #else
 
 #include <asm/bug.h>
-#include <asm/errno.h>
 
 static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
                                              struct irq_domain *domain)
@@ -789,8 +788,6 @@ int gpio_device_get_base(struct gpio_device *gdev);
 
 #else /* CONFIG_GPIOLIB */
 
-#include <linux/err.h>
-
 #include <asm/bug.h>
 
 static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
--
Quoted 2 lines

2.40.0

Applied, thanks!

Bart