ret is not initialized on failure to get the clock.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/video/stm32_ltdc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/stm32_ltdc.c b/drivers/video/stm32_ltdc.c
index 6b91ee18b962..7ebd24d6d908 100644
--- a/drivers/video/stm32_ltdc.c
+++ b/drivers/video/stm32_ltdc.c
@@ -269,10 +269,8 @@ static int ltdc_probe(struct device *dev)
        hw->regs = IOMEM(iores->start);
 
        hw->pclk = clk_get(dev, NULL);
-       if (IS_ERR(hw->pclk)) {
-               dev_err(dev, "peripheral clock get error %d\n", ret);
-               return PTR_ERR(hw->pclk);
-       }
+       if (IS_ERR(hw->pclk))
+               return dev_errp_probe(dev, hw->pclk, "peripheral clock get\n");
 
        for_each_available_child_of_node(dev->of_node, np) {
                struct ltdc_fb *priv;
-- 
2.39.5


Reply via email to