2024-01-25 08:16:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/3] gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB

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



2024-01-25 08:30:40

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/3] gpiolib: add gpio_device_get_base() stub for !GPIOLIB

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


2024-01-25 08:31:06

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 3/3] gpiolib: add gpio_device_get_label() stub for !GPIOLIB

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


2024-01-25 09:14:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] gpiolib: add gpio_device_get_label() stub for !GPIOLIB

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


2024-01-25 09:38:05

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB

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


2024-01-25 09:41:44

by Philipp Zabel

[permalink] [raw]
Subject: Re: [PATCH 3/3] gpiolib: add gpio_device_get_label() stub for !GPIOLIB

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

2024-01-25 10:46:15

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH 3/3] gpiolib: add gpio_device_get_label() stub for !GPIOLIB

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
>

2024-01-25 15:18:46

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH 3/3] gpiolib: add gpio_device_get_label() stub for !GPIOLIB

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
>

2024-01-31 09:07:03

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/3] gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB

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