pinctrl: da9062: don't pull in internal GPIOLIB headers
Subsystems (3)
cover pinctrl: da9062: don't pull in internal GPIOLIB headers
From: Bartosz Golaszewski <[email protected]>
I'm removing instances of users of internal GPIOLIB headers which should not be included by anyone but GPIO core code. The pinctrl-da9062 driver uses gpiochip_get_desc() which we should put into the gpio/driver.h header as it does sometimes make sense for GPIO providers to get its own descriptors without having to go through gpiochip_request_own_desc().
Bartosz Golaszewski (3):
pinctrl: da9062: add missing include
gpiolib: make gpiochip_get_desc() public
pinctrl: da9062: don't include private GPIOLIB header
drivers/gpio/gpiolib.h | 2 -- drivers/pinctrl/pinctrl-da9062.c | 7 +------ include/linux/gpio/driver.h | 2 ++ 3 files changed, 3 insertions(+), 8 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/3 pinctrl: da9062: add missing include
From: Bartosz Golaszewski <[email protected]>
gpiod_is_active_low() is defined in linux/gpio/consumer.h. It's only because we're pulling in the gpiolib.h private header that we get this declaration implicitly but let's fix it as that is going away soon.
--- drivers/pinctrl/pinctrl-da9062.c | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/pinctrl-da9062.c +1 -0
@@ -17,6 +17,7 @@#include <linux/property.h> #include <linux/regmap.h> +#include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> #include <linux/mfd/da9062/core.h>
Signature · 1 line
2.39.2
Re: [PATCH 1/3] pinctrl: da9062: add missing include
Quoted 7 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
gpiod_is_active_low()is defined inlinux/gpio/consumer.h. It's only because we're pulling in thegpiolib.hprivate header that we get this declaration implicitly but let's fix it as that is going away soon.Signed-off-by Bartosz Golaszewski <[email protected]>
For allt three patches.
Just apply them to the GPIO tree, that's easiest!
Yours,
Linus Walleij
Re: [PATCH 1/3] pinctrl: da9062: add missing include
Quoted 9 lines · Linus Walleij
Quoted 6 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
gpiod_is_active_low()is defined inlinux/gpio/consumer.h. It's only because we're pulling in thegpiolib.hprivate header that we get this declaration implicitly but let's fix it as that is going away soon.
Quoted 8 lines
Quoted 1 line
Signed-off-by Bartosz Golaszewski <[email protected]>Acked-by Linus Walleij <[email protected]>For allt three patches.
Just apply them to the GPIO tree, that's easiest!Yours,
Linus Walleij
Ok, queued, thanks!
Bart
PATCH 2/3 gpiolib: make gpiochip_get_desc() public
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
It makes sense for a GPIO driver to want to get its own descriptor without requesting it. After all, the driver knows that it'll still be valid. Let's move this helper to linux/gpio/driver.h.
--- drivers/gpio/gpiolib.h | 2 -- include/linux/gpio/driver.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpiolib.h +0 -2
@@ -122,8 +122,6 @@ struct gpio_array {unsigned long invert_mask[]; }; -struct gpio_desc *gpiochip_get_desc (struct gpio_chip *gc,unsigned int hwnum); -#define for_each_gpio_desc (gc, desc) \ for (unsigned int __i = 0; \ __i < gc->ngpio && (desc = gpiochip_get_desc(gc, __i)); \
include/linux/gpio/driver.h +2 -0
@@ -758,6 +758,8 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, enum gpiod_flags dflags);void gpiochip_free_own_desc (struct gpio_desc *desc); +struct gpio_desc *gpiochip_get_desc (struct gpio_chip *gc,unsigned int hwnum); +#ifdef CONFIG_GPIOLIB /* lock/unlock as IRQ */
Signature · 1 line
2.39.2
PATCH 3/3 pinctrl: da9062: don't include private GPIOLIB header
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
gpiochip_get_desc() now lives in linux/gpio/driver.h and there is no longer any need to include GPIOLIB's private header.
--- drivers/pinctrl/pinctrl-da9062.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/pinctrl/pinctrl-da9062.c +0 -6
@@ -23,12 +23,6 @@#include <linux/mfd/da9062/core.h> #include <linux/mfd/da9062/registers.h> -/* -* We need this get the gpio_desc from a <gpio_chip,offset> tuple to decide if -* the gpio is active low without a vendor specific dt-binding. -*/ -#include "../gpio/gpiolib.h" -#define DA9062_TYPE (offset) (4 * (offset % 2))#define DA9062_PIN_SHIFT (offset) (4 * (offset % 2))#define DA9062_PIN_ALTERNATE 0x00/* gpio alternate mode */
Signature · 1 line
2.39.2
Quoted 7 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
I'm removing instances of users of internal GPIOLIB headers which should not be included by anyone but GPIO core code. The pinctrl-da9062 driver uses
gpiochip_get_desc()which we should put into thegpio/driver.hheader as it does sometimes make sense for GPIO providers to get its own descriptors without having to go throughgpiochip_request_own_desc().
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 14 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
I'm removing instances of users of internal GPIOLIB headers which should not be included by anyone but GPIO core code. The pinctrl-da9062 driver uses
gpiochip_get_desc()which we should put into thegpio/driver.hheader as it does sometimes make sense for GPIO providers to get its own descriptors without having to go throughgpiochip_request_own_desc().Bartosz Golaszewski (3):
pinctrl: da9062: add missing include
gpiolib: makegpiochip_get_desc()public
pinctrl: da9062: don't include private GPIOLIB header
Quoted 8 lines
drivers/gpio/gpiolib.h | 2 -- drivers/pinctrl/pinctrl-da9062.c | 7 +------ include/linux/gpio/driver.h | 2 ++ 3 files changed, 3 insertions(+), 8 deletions(-)--
2.39.2
Linus,
Do you mind me taking these through the GPIO tree or do you prefer to apply them yourself in which case I'll apply patch 2/3 first and provide you with an immutable tag?
Bartosz