Skip to content

Commit

Permalink
ARM: OMAP4+: PRM: fix of_irq_get() result checks
Browse files Browse the repository at this point in the history
of_irq_get() may return 0 as well as a nagative error number on failure,
(and never on success), however omap44xx_prm_late_init() regards 0 as a
valid IRQ -- fix this.

Fixes: a8f83ae ("ARM: OMAP4+: PRM: register interrupt information from DT")
Fixes: c5b3955 ("ARM: OMAP4: Fix legacy code clean-up regression")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Sergei Shtylyov authored and Tony Lindgren committed Aug 15, 2017
1 parent d683878 commit 879dce7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/prm44xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ static int omap44xx_prm_late_init(void)
* Already have OMAP4 IRQ num. For all other platforms, we need
* IRQ numbers from DT
*/
if (irq_num < 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
if (irq_num <= 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
if (irq_num == -EPROBE_DEFER)
return irq_num;

Expand All @@ -756,7 +756,7 @@ static int omap44xx_prm_late_init(void)
}

/* Once OMAP4 DT is filled as well */
if (irq_num >= 0) {
if (irq_num > 0) {
omap4_prcm_irq_setup.irq = irq_num;
omap4_prcm_irq_setup.xlate_irq = NULL;
}
Expand Down

0 comments on commit 879dce7

Please sign in to comment.