From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Peter Rosin <peda@axentia.se>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH 1/3] gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB
Date: Thu, 25 Jan 2024 09:59:19 +0100 [thread overview]
Message-ID: <a3d24e7d-404e-4c02-99a2-8838ee7028c9@linaro.org> (raw)
In-Reply-To: <CAMRc=MesG1nYSxx0osmQEEXCvs-6B4s4=TFYW5wD8pOXpV+OcQ@mail.gmail.com>
On 25/01/2024 09:36, Bartosz Golaszewski wrote:
> On Thu, Jan 25, 2024 at 9:16 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> Add empty stub of gpiod_to_gpio_device() when GPIOLIB is not enabled.
>>
>> Cc: <stable@vger.kernel.org>
>> Fixes: 370232d096e3 ("gpiolib: provide gpiod_to_gpio_device()")
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>> ---
>>
>> Cc: Philipp Zabel <p.zabel@pengutronix.de>
>> ---
>> 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
next prev parent reply other threads:[~2024-01-25 8:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 8:15 [PATCH 1/3] gpiolib: add gpiod_to_gpio_device() stub for !GPIOLIB Krzysztof Kozlowski
2024-01-25 8:16 ` [PATCH 2/3] gpiolib: add gpio_device_get_base() " Krzysztof Kozlowski
2024-01-25 8:16 ` [PATCH 3/3] gpiolib: add gpio_device_get_label() " Krzysztof Kozlowski
2024-01-25 9:04 ` Bartosz Golaszewski
2024-01-25 9:14 ` Krzysztof Kozlowski
2024-01-25 9:28 ` Bartosz Golaszewski
2024-01-25 9:34 ` Philipp Zabel
2024-01-25 8:36 ` [PATCH 1/3] gpiolib: add gpiod_to_gpio_device() " Bartosz Golaszewski
2024-01-25 8:59 ` Krzysztof Kozlowski [this message]
2024-01-31 9:00 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3d24e7d-404e-4c02-99a2-8838ee7028c9@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=peda@axentia.se \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).