public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Revert "gpio: bail out silently on NULL descriptors"
Date: Fri, 17 Jun 2016 10:07:34 +0200	[thread overview]
Message-ID: <3e000ebd-6178-6591-cd17-d67aa0421d57@redhat.com> (raw)
In-Reply-To: <CACRpkdaYscNgwVaxJVD=m8e+yMrwvRHxhAHM4LPvBtrPKxXCSA@mail.gmail.com>

Hi,

On 15-06-16 23:04, Linus Walleij wrote:
> On Wed, Jun 15, 2016 at 8:22 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>
>> This reverts commit 54d77198fdfb("gpio: bail out silently on NULL
>> descriptors").
>>
>> This commit causes the following code to fail:
>>
>> gpio_desc = devm_gpiod_get_optional(dev, ...);
>> gpio_irq  = gpiod_to_irq(gpio_desc);
>> if (gpio_irq >= 0) {
>>         ret = devm_request_irq(dev, gpio_irq, ...);
>>
>> And now ret is an error causing the probe function in question to bail.
>>
>> The problem here is that gpiod_to_irq now returns 0 for a NULL
>> gpio_desc while 0 is a valid irq-nr. Also see:
>> commit 4c37ce8608a8("gpio: make gpiod_to_irq() return negative for NO_IRQ")
>> which specifically avoids returning 0.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> The first commit was done to fix another regression so if I revert it I get
> back the first regression.

Ok.

> I guess what we need to do is simply make gpiod_to_irq() a
> special case and have it behave the way expected for now?

That is fine with me.

> Hans: I sent a patch like that if it works for you could you give
> me your Tested-by?

I've just checked the code and code-wise it looks good. I'll test
it on actual hw later today.

Regards,

Hans

      reply	other threads:[~2016-06-17  8:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 18:22 [PATCH] Revert "gpio: bail out silently on NULL descriptors" Hans de Goede
2016-06-15 18:46 ` Maxime Ripard
2016-06-15 19:08   ` Hans de Goede
2016-06-16  9:23     ` Grygorii Strashko
2016-06-16  9:53       ` Linus Walleij
2016-06-17  8:05         ` Hans de Goede
2016-06-17  8:04       ` Hans de Goede
2016-06-15 21:04 ` Linus Walleij
2016-06-17  8:07   ` Hans de Goede [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=3e000ebd-6178-6591-cd17-d67aa0421d57@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.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