Skip to content

Commit

Permalink
Input: twl4030_keypad - Fix handling of platform_get_irq() error
Browse files Browse the repository at this point in the history
platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: 7abf38d ("Input: twl4030-keypad - add device tree support")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
  • Loading branch information
krzk authored and intel-lab-lkp committed Aug 27, 2020
1 parent 2e514e9 commit d83af67
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/input/keyboard/twl4030_keypad.c
Expand Up @@ -376,10 +376,8 @@ static int twl4030_kp_probe(struct platform_device *pdev)
}

kp->irq = platform_get_irq(pdev, 0);
if (!kp->irq) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
return -EINVAL;
}
if (kp->irq < 0)
return kp->irq;

error = matrix_keypad_build_keymap(keymap_data, NULL,
TWL4030_MAX_ROWS,
Expand Down

0 comments on commit d83af67

Please sign in to comment.