mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform: don't return 0 from platform_get_irq[_byname]() on error
Date: Fri, 10 Jun 2016 15:11:17 +0300	[thread overview]
Message-ID: <c5a50ead-1be3-5794-dd35-8dc3808ba638@cogentembedded.com> (raw)
In-Reply-To: <2253608.yVZdxzQuTN@wasted.cogentembedded.com>

Hello.

On 5/28/2016 11:51 PM, Sergei Shtylyov wrote:

> of_irq_get[_byname]() return 0 iff irq_create_of_mapping() call fails.
> Returning both  error code and 0 on failure is a sign of a misdesigned API.
> We  should rely on the platform IRQ resource in this case, not return 0,
> especially as 0 can be a valid  IRQ resource too...

    Actually, I wanted to say that returning 0 on error makes the error check 
unnecessarily complex and error prone bu fogrgot about that when writing the 
changelog. Let me know what you think...

> Fixes: aff008ad813c ("platform_get_irq: Revert to platform_get_resource if of_irq_get fails")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> CC: stable@vger.kernel.org

[...]

MBR, Sergei

      reply	other threads:[~2016-06-10 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28 20:51 Sergei Shtylyov
2016-06-10 12:11 ` Sergei Shtylyov [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=c5a50ead-1be3-5794-dd35-8dc3808ba638@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®