[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250412193153.49138-1-chenyuan0y@gmail.com>
Date: Sat, 12 Apr 2025 14:31:53 -0500
From: Chenyuan Yang <chenyuan0y@...il.com>
To: linus.walleij@...aro.org,
brgl@...ev.pl,
theo.lebrun@...tlin.com
Cc: linux-arm-kernel@...ts.infradead.org,
linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chenyuan Yang <chenyuan0y@...il.com>
Subject: [PATCH] gpio: nomadik: Add check for clk_enable()
Add check for the return value of clk_enable() to catch
the potential error.
This is similar to the commit 8332e6670997
("spi: zynq-qspi: Add check for clk_enable()").
Signed-off-by: Chenyuan Yang <chenyuan0y@...il.com>
Fixes: 966942ae4936 ("gpio: nomadik: extract GPIO platform driver from drivers/pinctrl/nomadik/")
---
drivers/gpio/gpio-nomadik.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index fa19a44943fd..dbc4cdddf4df 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -262,8 +262,11 @@ static unsigned int nmk_gpio_irq_startup(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct nmk_gpio_chip *nmk_chip = gpiochip_get_data(gc);
+ int ret;
- clk_enable(nmk_chip->clk);
+ ret = clk_enable(nmk_chip->clk);
+ if (ret)
+ return ret;
nmk_gpio_irq_unmask(d);
return 0;
}
--
2.34.1
Powered by blists - more mailing lists