rtc: asm9260: add the missed check for devm_clk_get
authorChuhong Yuan <hslester96@gmail.com>
Sat, 14 Dec 2019 07:45:28 +0000 (15:45 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 23 Dec 2019 10:16:23 +0000 (11:16 +0100)
The driver misses a check for devm_clk_get().
Add the check to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20191214074528.16806-1-hslester96@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-asm9260.c

index 10064bdabdffa1a9c61565c192db0fe132a337de..3ab81cdec00bc7ee565b9a866a6fce2f13d127cb 100644 (file)
@@ -264,6 +264,9 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
                return PTR_ERR(priv->iobase);
 
        priv->clk = devm_clk_get(dev, "ahb");
+       if (IS_ERR(priv->clk))
+               return PTR_ERR(priv->clk);
+
        ret = clk_prepare_enable(priv->clk);
        if (ret) {
                dev_err(dev, "Failed to enable clk!\n");