From: Arvind Yadav Date: Fri, 19 May 2017 10:56:04 +0000 (+0530) Subject: PM / devfreq: exynos-ppmu: Handle return value of clk_prepare_enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=97a6ba5bd0b54544fabe090711fabefc7a703a5f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git PM / devfreq: exynos-ppmu: Handle return value of clk_prepare_enable clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav Signed-off-by: MyungJoo Ham --- diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index 9b7350935b73..8f6537aa989b 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -648,7 +648,11 @@ static int exynos_ppmu_probe(struct platform_device *pdev) dev_name(&pdev->dev), desc[i].name); } - clk_prepare_enable(info->ppmu.clk); + ret = clk_prepare_enable(info->ppmu.clk); + if (ret) { + dev_err(&pdev->dev, "failed to prepare ppmu clock\n"); + return ret; + } return 0; }