]> git.baikalelectronics.ru Git - kernel.git/commit
platform: don't return 0 from platform_get_irq[_byname]() on error
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 3 Jul 2016 22:04:24 +0000 (01:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2016 13:19:55 +0000 (15:19 +0200)
commitf9ecb1c203866dddb5f0f89842ac73f6df9b4033
tree6a46cd1950f8523633b2c17ff9af9f4a8563ed99
parent9a9dfcc929777ca0e828f189c1f760a4ae857089
platform: don't return 0 from platform_get_irq[_byname]() on error

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,
it makes the failure check unnecessarily complex and error prone. We should
rely  on the platform IRQ resource in this case, not return 0,  especially
as 0 can be  a valid  IRQ resource too...

Fixes: b647ef5d49e4 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c