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

From: Sergei Shtylyov
Date: Fri Jun 10 2016 - 08:11:26 EST


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@xxxxxxxxxxxxxxxxxx>
CC: stable@xxxxxxxxxxxxxxx

[...]

MBR, Sergei