lkml.org 
[lkml]   [2016]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] platform: don't return 0 from platform_get_irq[_byname]() on error
From
Date
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

\
 
 \ /
  Last update: 2016-06-10 14:41    [W:0.060 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site