Skip to contentSkip to conversation

clk: lmk04832: Handle reset GPIO lookup errors

PATCH Applied [email protected] 2 participants 2 messages Oct 6 – Oct 7 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: lmk04832: Handle reset GPIO lookup errors

From: bui duc phuc <[email protected]>

devm_gpiod_get_optional() may return -EPROBE_DEFER or other errors, but lmk04832_probe() currently ignores them.

Check the return value and propagate errors from the reset GPIO lookup.

Fixes 3bc61cfd6f4a ("clk: add support for the lmk04832")
---
 drivers/clk/clk-lmk04832.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/clk-lmk04832.c +3 -0
index f9a0684d2628..81801ccb2675 100644
@@ -1410,6 +1410,9 @@ static int lmk04832_probe(struct spi_device *spi)
 
 	lmk->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
 						  GPIOD_OUT_LOW);
+	if (IS_ERR(lmk->reset_gpio))
+		return dev_err_probe(lmk->dev, PTR_ERR(lmk->reset_gpio),
+				     "failed to get reset GPIO\n");
 
 	lmk->dclk = devm_kcalloc(lmk->dev, info->num_channels >> 1,
 				 sizeof(struct lmk_dclk), GFP_KERNEL);
Signature · 1 line
2.43.0
#1 lore raw

Applied to clk/linux.git (clk-next), thanks!

[1/1] clk: lmk04832: Handle reset GPIO lookup errors

      commit: da51c9a6f60ab1eead089c23448c9ee6a192635b

Best regards,
--
Jerome