mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Input: twl4030_keypad - fix handling of platform_get_irq() error
[ Upstream commit c277e1f0dc3c7d7b5b028e20dd414df241642036 ]
platform_get_irq() returns -ERRNO on error. In such case casting to
unsigned and comparing to 0 would pass the check.
Fixes: 7abf38d6d1 ("Input: twl4030-keypad - add device tree support")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
2f967303cb
commit
cb3b77359a
1 changed files with 3 additions and 5 deletions
|
|
@ -50,7 +50,7 @@ struct twl4030_keypad {
|
|||
bool autorepeat;
|
||||
unsigned int n_rows;
|
||||
unsigned int n_cols;
|
||||
unsigned int irq;
|
||||
int irq;
|
||||
|
||||
struct device *dbg_dev;
|
||||
struct input_dev *input;
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue