[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230605015345.12801-1-jiasheng@iscas.ac.cn>
Date: Mon, 5 Jun 2023 09:53:45 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: andy.shevchenko@...il.com
Cc: oe-kbuild-all@...ts.linux.dev, linus.walleij@...aro.org,
brgl@...ev.pl, palmer@...belt.com, paul.walmsley@...ive.com,
linux-gpio@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org, Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH v3] gpio: ath79: Add missing check for platform_get_irq
Add the missing check for platform_get_irq() and return error
if it fails.
Fixes: 2b8f89e19b6d ("gpio: ath79: Add support for the interrupt controller")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
Changelog:
v2 -> v3:
1. Check before assigning values.
v1 -> v2:
1. Return "girq->parents[0]" instead of "-ENODEV".
---
drivers/gpio/gpio-ath79.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index aa0a954b8392..d2d838ad33bb 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -285,7 +285,10 @@ static int ath79_gpio_probe(struct platform_device *pdev)
GFP_KERNEL);
if (!girq->parents)
return -ENOMEM;
- girq->parents[0] = platform_get_irq(pdev, 0);
+ err = platform_get_irq(pdev, 0);
+ if (err < 0)
+ return err;
+ girq->parents[0] = err;
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_simple_irq;
}
--
2.25.1
Powered by blists - more mailing lists