clk: lmk04832: Handle reset GPIO lookup errors
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")
Signed-off-by bui duc phuc <[email protected]>
--- drivers/clk/clk-lmk04832.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/clk/clk-lmk04832.c +3 -0
@@ -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
Jerome Brunet
AppliedApplied to clk/linux.git (clk-next), thanks!
[1/1] clk: lmk04832: Handle reset GPIO lookup errors
commit: da51c9a6f60ab1eead089c23448c9ee6a192635b
Best regards,
--
Jerome