Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@suse.com>2019-08-08 12:22:02 +0200
committerMian Yousaf Kaukab <yousaf.kaukab@suse.com>2019-08-08 12:22:17 +0200
commit884e2c703e7e59b4d198d8621986fea4e5bafdfa (patch)
treeb9e2796e6fe08711e1bf409c37d6c83d01d079c5
parent175228747bc5fba0506f65b72aede47c1ffc726f (diff)
soc: rockchip: power-domain: Use of_clk_get_parent_count()
instead of open coding (bsc#1144718,bsc#1144813).
-rw-r--r--patches.drivers/0005-soc-rockchip-power-domain-Use-of_clk_get_parent_coun.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.drivers/0005-soc-rockchip-power-domain-Use-of_clk_get_parent_coun.patch b/patches.drivers/0005-soc-rockchip-power-domain-Use-of_clk_get_parent_coun.patch
new file mode 100644
index 0000000000..0145ef3e87
--- /dev/null
+++ b/patches.drivers/0005-soc-rockchip-power-domain-Use-of_clk_get_parent_coun.patch
@@ -0,0 +1,48 @@
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Wed, 18 Apr 2018 16:50:03 +0200
+Subject: soc: rockchip: power-domain: Use of_clk_get_parent_count() instead of
+ open coding
+
+Git-commit: 54d52ad940bb50284c85adcf481413fb3b82925a
+Patch-mainline: v4.18-rc1
+References: bsc#1144718,bsc#1144813
+
+As of_clk_get_parent_count() returns zero on failure, while
+of_count_phandle_with_args() might return a negative error code, this
+also fixes the issue of possibly using a negative number in the
+allocation below.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Reviewed-by: Heiko Stuebner <heiko@sntech.de>
+Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/soc/rockchip/pm_domains.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
+index 53efc386b1ad..13913d40c821 100644
+--- a/drivers/soc/rockchip/pm_domains.c
++++ b/drivers/soc/rockchip/pm_domains.c
+@@ -14,6 +14,7 @@
+ #include <linux/pm_clock.h>
+ #include <linux/pm_domain.h>
+ #include <linux/of_address.h>
++#include <linux/clk-provider.h>
+ #include <linux/of_platform.h>
+ #include <linux/clk.h>
+ #include <linux/regmap.h>
+@@ -400,8 +401,7 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
+ pd->info = pd_info;
+ pd->pmu = pmu;
+
+- pd->num_clks = of_count_phandle_with_args(node, "clocks",
+- "#clock-cells");
++ pd->num_clks = of_clk_get_parent_count(node);
+ if (pd->num_clks > 0) {
+ pd->clks = devm_kcalloc(pmu->dev, pd->num_clks,
+ sizeof(*pd->clks), GFP_KERNEL);
+--
+2.11.0
+
diff --git a/series.conf b/series.conf
index 22b533272f..cc5682d03b 100644
--- a/series.conf
+++ b/series.conf
@@ -17249,6 +17249,7 @@
patches.drivers/0001-md-fix-two-problems-with-setting-the-re-add-device-s.patch
patches.fixes/md-fix-NULL-dereference-of-mddev-pers-in-remove_and_.patch
patches.fixes/md-raid1-add-error-handling-of-read-error-from-FailF.patch
+ patches.drivers/0005-soc-rockchip-power-domain-Use-of_clk_get_parent_coun.patch
patches.drivers/clk-qcom-Base-rcg-parent-rate-off-plan-frequency
patches.drivers/clk-imx7d-fix-mipi-dphy-div-parent
patches.drivers/clk-mvebu-use-correct-bit-for-98DX3236-NAND