Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b3d2243 authored by Fabio Estevam's avatar Fabio Estevam Committed by Linus Torvalds
Browse files

drivers/rtc/rtc-mxc.c: check the return value from clk_prepare_enable()



clk_prepare_enable() may fail, so let's check its return value and
propagate it in the case of error.

Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fbd5e754
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -394,7 +394,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
		return PTR_ERR(pdata->clk);
	}

	clk_prepare_enable(pdata->clk);
	ret = clk_prepare_enable(pdata->clk);
	if (ret)
		return ret;

	rate = clk_get_rate(pdata->clk);

	if (rate == 32768)