Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334119 > unrolled thread

[PATCH 2/6] clk: rockchip: check grf when waiting pll lock

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-02-15 04:40 +0100
Last post2016-02-15 22:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/6] clk: rockchip: check grf when waiting pll lock Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 04:40 +0100
    Re: [PATCH 2/6] clk: rockchip: check grf when waiting pll lock Heiko Stuebner <heiko@sntech.de> - 2016-02-15 22:50 +0100

#1334119 — [PATCH 2/6] clk: rockchip: check grf when waiting pll lock

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-02-15 04:40 +0100
Subject[PATCH 2/6] clk: rockchip: check grf when waiting pll lock
Message-ID<r2iaZ-3Gn-1@gated-at.bofh.it>
rockchip_clk_get_grf pass on return value from
syscon_regmap_lookup_by_phandle, so we check grf to
make sure whether to do the following things or not.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/clk/rockchip/clk-pll.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c
index b7e66c9..dddbc29 100644
--- a/drivers/clk/rockchip/clk-pll.c
+++ b/drivers/clk/rockchip/clk-pll.c
@@ -90,10 +90,16 @@ static long rockchip_pll_round_rate(struct clk_hw *hw,
  */
 static int rockchip_pll_wait_lock(struct rockchip_clk_pll *pll)
 {
-	struct regmap *grf = rockchip_clk_get_grf();
+	struct regmap *grf;
 	unsigned int val;
 	int delay = 24000000, ret;
 
+	grf = rockchip_clk_get_grf();
+	if (IS_ERR(grf)) {
+		pr_err("%s: grf regmap not available\n", __func__);
+		return -ENODEV;
+	}
+
 	while (delay > 0) {
 		ret = regmap_read(grf, pll->lock_offset, &val);
 		if (ret) {
-- 
2.3.7

[toc] | [next] | [standalone]


#1334846

FromHeiko Stuebner <heiko@sntech.de>
Date2016-02-15 22:50 +0100
Message-ID<r2zbQ-6MM-7@gated-at.bofh.it>
In reply to#1334119
Am Montag, 15. Februar 2016, 11:33:25 schrieb Shawn Lin:
> rockchip_clk_get_grf pass on return value from
> syscon_regmap_lookup_by_phandle, so we check grf to
> make sure whether to do the following things or not.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

applied to my clk-branch for 4.6 with one change below

> ---
> 
>  drivers/clk/rockchip/clk-pll.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/rockchip/clk-pll.c
> b/drivers/clk/rockchip/clk-pll.c index b7e66c9..dddbc29 100644
> --- a/drivers/clk/rockchip/clk-pll.c
> +++ b/drivers/clk/rockchip/clk-pll.c
> @@ -90,10 +90,16 @@ static long rockchip_pll_round_rate(struct clk_hw *hw,
> */
>  static int rockchip_pll_wait_lock(struct rockchip_clk_pll *pll)
>  {
> -	struct regmap *grf = rockchip_clk_get_grf();
> +	struct regmap *grf;
>  	unsigned int val;
>  	int delay = 24000000, ret;
> 
> +	grf = rockchip_clk_get_grf();
> +	if (IS_ERR(grf)) {
> +		pr_err("%s: grf regmap not available\n", __func__);
> +		return -ENODEV;

I've changed that to PTR_ERR(grf), similar to the preexisting checks


Heiko

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web