mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: "Bartosz Golaszewski" <brgl@bgdev.pl>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] gpiolib: Allow to use setters with return value for output-only gpios
Date: Fri, 11 Apr 2025 13:56:58 +0200	[thread overview]
Message-ID: <D93SHIBVZQTE.1U2YFWQT253SW@bootlin.com> (raw)
In-Reply-To: <CAMRc=MegvXZGAVA210rjnFuKZwg4appN4nAJNejfC2jpY0JLOg@mail.gmail.com>

On Fri Apr 11, 2025 at 1:38 PM CEST, Bartosz Golaszewski wrote:
> On Fri, Apr 11, 2025 at 12:31 PM Mathieu Dubois-Briand
> <mathieu.dubois-briand@bootlin.com> wrote:
>>
>> The gpiod_direction_output_raw_commit() function checks if any setter
>> callback is present before doing anything. As the new GPIO setters with
>> return values were introduced, make this check also succeed if one is
>> present.
>>
>> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
>> ---
>>  drivers/gpio/gpiolib.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
>> index b8197502a5ac..cd4fecbb41f2 100644
>> --- a/drivers/gpio/gpiolib.c
>> +++ b/drivers/gpio/gpiolib.c
>> @@ -2879,7 +2879,7 @@ static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)
>>          * output-only, but if there is then not even a .set() operation it
>>          * is pretty tricky to drive the output line.
>>          */
>> -       if (!guard.gc->set && !guard.gc->direction_output) {
>> +       if (!guard.gc->set && !guard.gc->set_rv && !guard.gc->direction_output) {
>>                 gpiod_warn(desc,
>>                            "%s: missing set() and direction_output() operations\n",
>>                            __func__);
>>
>> ---
>> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
>> change-id: 20250411-mdb-gpiolib-setters-fix-b87976992070
>>
>> Best regards,
>> --
>> Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
>>
>
> Ah good catch. Since the culprit is already in mainline, would you
> mind resending with Cc: stable and Fixes: tags?
>
> Bart

Thanks, I had a doubt about stable, as I believe this only reached rc1
so far. I will send a new version a bit later today.

Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


      reply	other threads:[~2025-04-11 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 10:31 Mathieu Dubois-Briand
2025-04-11 11:38 ` Bartosz Golaszewski
2025-04-11 11:56   ` Mathieu Dubois-Briand [this message]

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=D93SHIBVZQTE.1U2YFWQT253SW@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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

all inboxes | Powered by JetHome®