Thread (4 messages) 4 messages, 3 authors, 2017-05-24

[PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable

From: cw00.choi@samsung.com (Chanwoo Choi)
Date: 2017-05-23 09:42:14
Also in: linux-pm, linux-samsung-soc, lkml

On 2017? 05? 19? 19:56, Arvind Yadav wrote:
quoted hunk ↗ jump to hunk
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <redacted>
---
 drivers/devfreq/event/exynos-ppmu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index 9b73509..8f6537a 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;
+	}
You're right. But, actually, some ppmu device-tree node doesn't include
the clock information because exynos clk driver don't support the
clock for some ppmu devices. Until now, the clock of ppmu devices
are default on state.

Before applying this patch, exynos clock driver have to support
the ppmu's clock and then add the clock information to the device tree
of ppmu devices.
 
 	return 0;
 }

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help