summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-09-16 03:52:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 11:07:12 +0300
commitbac6ea43d9ef52e3528583b030ae14eeb4114740 (patch)
tree689c0c95a6c9cc3a9862f1bab1d791e694263230
parent4cf86bec24fad44533462d12cb893f864ac7bba0 (diff)
downloadlinux-bac6ea43d9ef52e3528583b030ae14eeb4114740.tar.xz
Input: omap4-keypad - fix handling of platform_get_irq() error
[ Upstream commit 4738dd1992fa13acfbbd71800c71c612f466fa44 ] platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: f3a1ba60dbdb ("Input: omap4-keypad - use platform device helpers") Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200828145744.3636-2-krzk@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/input/keyboard/omap4-keypad.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 616fdd94b069..5480f1a5658e 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -253,10 +253,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
- if (!irq) {
- dev_err(&pdev->dev, "no keyboard irq assigned\n");
- return -EINVAL;
- }
+ if (irq < 0)
+ return irq;
keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
if (!keypad_data) {