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>
Fri, 28 Oct 2016 07:01:26 +0000 (03:01 -0400)
commit3fc96b9e2bd08f730df18b079a2036cddab021b7
tree0d98fb27387aa3750b4c7bfce62b9dc0f29622fa
parente7837af6160e9b717ed12fc9fd1012e28c55e3cf
platform: don't return 0 from platform_get_irq[_byname]() on error

commit e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af upstream.

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: aff008ad813c ("platform_get_irq: Revert to platform_get_resource if of_irq_get fails")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c