Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1419324

Re: [PATCH] platform: don't return 0 from platform_get_irq[_byname]() on error

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH] platform: don't return 0 from platform_get_irq[_byname]() on error
Date 2016-06-10 14:20 +0200
Message-ID <rItzQ-4sE-17@gated-at.bofh.it> (permalink)
References <rDTuW-5dM-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] platform: don't return 0 from platform_get_irq[_byname]()  on error Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-10 14:20 +0200

csiph-web