Add empty stub of gpiod_to_gpio_device() when GPIOLIB is not enabled.
Cc: <[email protected]>
Fixes: 370232d096e3 ("gpiolib: provide gpiod_to_gpio_device()")
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Cc: Philipp Zabel <[email protected]>
---
include/linux/gpio/driver.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 9a5c6c76e653..012797e7106d 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -819,6 +819,12 @@ static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
return ERR_PTR(-ENODEV);
}
+static inline struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc)
+{
+ WARN_ON(1);
+ return ERR_PTR(-ENODEV);
+}
+
static inline int gpiochip_lock_as_irq(struct gpio_chip *gc,
unsigned int offset)
{
--
2.34.1
Add empty stub of gpio_device_get_base() when GPIOLIB is not enabled.
Cc: <[email protected]>
Fixes: 8c85a102fc4e ("gpiolib: provide gpio_device_get_base()")
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Cc: Philipp Zabel <[email protected]>
---
include/linux/gpio/driver.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 012797e7106d..c1df7698edb0 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -825,6 +825,12 @@ static inline struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc)
return ERR_PTR(-ENODEV);
}
+static inline int gpio_device_get_base(struct gpio_device *gdev)
+{
+ WARN_ON(1);
+ return -ENODEV;
+}
+
static inline int gpiochip_lock_as_irq(struct gpio_chip *gc,
unsigned int offset)
{
--
2.34.1
Add empty stub of gpio_device_get_label() when GPIOLIB is not enabled.
Cc: <[email protected]>
Fixes: d1f7728259ef ("gpiolib: provide gpio_device_get_label()")
Suggested-by: kernel test robot <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Cc: Philipp Zabel <[email protected]>
Reset framework will need it:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
---
include/linux/gpio/driver.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index c1df7698edb0..7f75c9a51874 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -831,6 +831,12 @@ static inline int gpio_device_get_base(struct gpio_device *gdev)
return -ENODEV;
}
+static inline const char *gpio_device_get_label(struct gpio_device *gdev)
+{
+ WARN_ON(1);
+ return NULL;
+}
+
static inline int gpiochip_lock_as_irq(struct gpio_chip *gc,
unsigned int offset)
{
--
2.34.1
On 25/01/2024 10:04, Bartosz Golaszewski wrote:
> On Thu, Jan 25, 2024 at 9:16 AM Krzysztof Kozlowski
> <[email protected]> wrote:
>>
>> Add empty stub of gpio_device_get_label() when GPIOLIB is not enabled.
>>
>> Cc: <[email protected]>
>> Fixes: d1f7728259ef ("gpiolib: provide gpio_device_get_label()")
>> Suggested-by: kernel test robot <[email protected]>
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>>
>> ---
>>
>> Cc: Philipp Zabel <[email protected]>
>>
>> Reset framework will need it:
>> https://lore.kernel.org/oe-kbuild-all/[email protected]/
>
> And I suppose you'll want an immutable branch for that?
I guess that's the question to Philipp, but other way could be an Ack.
Best regards,
Krzysztof
On 25/01/2024 09:36, Bartosz Golaszewski wrote:
> On Thu, Jan 25, 2024 at 9:16 AM Krzysztof Kozlowski
> <[email protected]> wrote:
>>
>> Add empty stub of gpiod_to_gpio_device() when GPIOLIB is not enabled.
>>
>> Cc: <[email protected]>
>> Fixes: 370232d096e3 ("gpiolib: provide gpiod_to_gpio_device()")
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>>
>> ---
>>
>> Cc: Philipp Zabel <[email protected]>
>> ---
>> include/linux/gpio/driver.h | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
>> index 9a5c6c76e653..012797e7106d 100644
>> --- a/include/linux/gpio/driver.h
>> +++ b/include/linux/gpio/driver.h
>> @@ -819,6 +819,12 @@ static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
>> return ERR_PTR(-ENODEV);
>> }
>>
>> +static inline struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc)
>> +{
>> + WARN_ON(1);
>> + return ERR_PTR(-ENODEV);
>> +}
>> +
>> static inline int gpiochip_lock_as_irq(struct gpio_chip *gc,
>> unsigned int offset)
>> {
>> --
>> 2.34.1
>>
>
> Why is this needed? Users of gpio/driver.h should select GPIOLIB.
The third patch shows you the user which will not select GPIOLIB. Why?
Because there is no hard dependency between one core framework (RESET)
on other core framework (GPIOLIB).
The first two patches are added for the same purpose, even though there
is no need currently.
Best regards,
Krzysztof
On Do, 2024-01-25 at 10:28 +0100, Bartosz Golaszewski wrote:
> On Thu, Jan 25, 2024 at 10:14 AM Krzysztof Kozlowski
> <[email protected]> wrote:
> >
> > On 25/01/2024 10:04, Bartosz Golaszewski wrote:
> > > On Thu, Jan 25, 2024 at 9:16 AM Krzysztof Kozlowski
> > > <[email protected]> wrote:
> > > >
> > > > Add empty stub of gpio_device_get_label() when GPIOLIB is not enabled.
> > > >
> > > > Cc: <[email protected]>
> > > > Fixes: d1f7728259ef ("gpiolib: provide gpio_device_get_label()")
> > > > Suggested-by: kernel test robot <[email protected]>
> > > > Signed-off-by: Krzysztof Kozlowski <[email protected]>
> > > >
> > > > ---
> > > >
> > > > Cc: Philipp Zabel <[email protected]>
> > > >
> > > > Reset framework will need it:
> > > > https://lore.kernel.org/oe-kbuild-all/[email protected]/
> > >
> > > And I suppose you'll want an immutable branch for that?
> >
> > I guess that's the question to Philipp, but other way could be an Ack.
> >
>
> I prefer it to go through my tree in case of conflicts as I have a big
> refactor coming up. I'll give it a day or two on the list and set up a
> tag for Philipp.
Works for me, thank you.
regards
Philipp
On Thu, Jan 25, 2024 at 10:14 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> On 25/01/2024 10:04, Bartosz Golaszewski wrote:
> > On Thu, Jan 25, 2024 at 9:16 AM Krzysztof Kozlowski
> > <[email protected]> wrote:
> >>
> >> Add empty stub of gpio_device_get_label() when GPIOLIB is not enabled.
> >>
> >> Cc: <[email protected]>
> >> Fixes: d1f7728259ef ("gpiolib: provide gpio_device_get_label()")
> >> Suggested-by: kernel test robot <[email protected]>
> >> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> >>
> >> ---
> >>
> >> Cc: Philipp Zabel <[email protected]>
> >>
> >> Reset framework will need it:
> >> https://lore.kernel.org/oe-kbuild-all/[email protected]/
> >
> > And I suppose you'll want an immutable branch for that?
>
> I guess that's the question to Philipp, but other way could be an Ack.
>
I prefer it to go through my tree in case of conflicts as I have a big
refactor coming up. I'll give it a day or two on the list and set up a
tag for Philipp.
Bartosz
> Best regards,
> Krzysztof
>
On Thu, Jan 25, 2024 at 9:16 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> Add empty stub of gpio_device_get_label() when GPIOLIB is not enabled.
>
> Cc: <[email protected]>
> Fixes: d1f7728259ef ("gpiolib: provide gpio_device_get_label()")
> Suggested-by: kernel test robot <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Cc: Philipp Zabel <[email protected]>
>
> Reset framework will need it:
> https://lore.kernel.org/oe-kbuild-all/[email protected]/
And I suppose you'll want an immutable branch for that?
Bart
> ---
> include/linux/gpio/driver.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index c1df7698edb0..7f75c9a51874 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -831,6 +831,12 @@ static inline int gpio_device_get_base(struct gpio_device *gdev)
> return -ENODEV;
> }
>
> +static inline const char *gpio_device_get_label(struct gpio_device *gdev)
> +{
> + WARN_ON(1);
> + return NULL;
> +}
> +
> static inline int gpiochip_lock_as_irq(struct gpio_chip *gc,
> unsigned int offset)
> {
> --
> 2.34.1
>
On Thu, Jan 25, 2024 at 9:59 AM Krzysztof Kozlowski
<[email protected]> wrote:
> [Bart]
> > Why is this needed? Users of gpio/driver.h should select GPIOLIB.
>
> The third patch shows you the user which will not select GPIOLIB. Why?
> Because there is no hard dependency between one core framework (RESET)
> on other core framework (GPIOLIB).
>
> The first two patches are added for the same purpose, even though there
> is no need currently.
That reset driver implementing a GPIO chip has not been reviewed by the
GPIO maintainers so I looked up the patch and replied, we have
review comments.
Yours,
Linus Walleij