linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration
@ 2016-10-06 14:59 ` Javier Martinez Canillas
  2016-10-06 17:22   ` Krzysztof Kozlowski
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2016-10-06 14:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Markus Reichl, Tobias Jakobi, Javier Martinez Canillas,
	Michael Turquette, Stephen Boyd, Chanwoo Choi,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, linux-clk

The commit 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and
registration APIs") converted the driver to use the new provider API to
register clocks using clk_hw.

But unfortunately, in the conversion it missed to set the num_clks value
which lead to the following error when trying to register a clk provider:

[    1.963782] of_clk_max77686_get: invalid index 0
[    1.967460] ERROR: could not get clock /rtc@10070000:rtc_src(1)
[    1.973638] s3c-rtc 10070000.rtc: failed to find rtc source clock

Fix it by correctly set the max77686_clk_driver_data num_clks member.

Fixes: 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and registration APIs")
Reported-by: Markus Reichl <m.reichl@fivetechno.de>
Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>

---

 drivers/clk/clk-max77686.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index b637f5979023..eb953d3b0b69 100644
--- a/drivers/clk/clk-max77686.c
+++ b/drivers/clk/clk-max77686.c
@@ -216,6 +216,7 @@ static int max77686_clk_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	drv_data->num_clks = num_clks;
 	drv_data->max_clk_data = devm_kcalloc(dev, num_clks,
 					      sizeof(*drv_data->max_clk_data),
 					      GFP_KERNEL);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration
  2016-10-06 14:59 ` [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration Javier Martinez Canillas
@ 2016-10-06 17:22   ` Krzysztof Kozlowski
  2016-10-07  0:36   ` Chanwoo Choi
  2016-10-17 22:30   ` Stephen Boyd
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2016-10-06 17:22 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: linux-kernel, Markus Reichl, Tobias Jakobi, Michael Turquette,
	Stephen Boyd, Chanwoo Choi, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, linux-clk

On Thu, Oct 06, 2016 at 11:59:59AM -0300, Javier Martinez Canillas wrote:
> The commit 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and
> registration APIs") converted the driver to use the new provider API to
> register clocks using clk_hw.
> 
> But unfortunately, in the conversion it missed to set the num_clks value
> which lead to the following error when trying to register a clk provider:
> 
> [    1.963782] of_clk_max77686_get: invalid index 0
> [    1.967460] ERROR: could not get clock /rtc@10070000:rtc_src(1)
> [    1.973638] s3c-rtc 10070000.rtc: failed to find rtc source clock
> 
> Fix it by correctly set the max77686_clk_driver_data num_clks member.
> 
> Fixes: 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and registration APIs")
> Reported-by: Markus Reichl <m.reichl@fivetechno.de>
> Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Markus Reichl <m.reichl@fivetechno.de>
> 
> ---
> 
>  drivers/clk/clk-max77686.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration
  2016-10-06 14:59 ` [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration Javier Martinez Canillas
  2016-10-06 17:22   ` Krzysztof Kozlowski
@ 2016-10-07  0:36   ` Chanwoo Choi
  2016-10-17 22:30   ` Stephen Boyd
  2 siblings, 0 replies; 4+ messages in thread
From: Chanwoo Choi @ 2016-10-07  0:36 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Markus Reichl, Tobias Jakobi, Michael Turquette, Stephen Boyd,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, linux-clk

Hi Javier,

On 2016년 10월 06일 23:59, Javier Martinez Canillas wrote:
> The commit 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and
> registration APIs") converted the driver to use the new provider API to
> register clocks using clk_hw.
> 
> But unfortunately, in the conversion it missed to set the num_clks value
> which lead to the following error when trying to register a clk provider:
> 
> [    1.963782] of_clk_max77686_get: invalid index 0
> [    1.967460] ERROR: could not get clock /rtc@10070000:rtc_src(1)
> [    1.973638] s3c-rtc 10070000.rtc: failed to find rtc source clock
> 
> Fix it by correctly set the max77686_clk_driver_data num_clks member.
> 
> Fixes: 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and registration APIs")
> Reported-by: Markus Reichl <m.reichl@fivetechno.de>
> Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Markus Reichl <m.reichl@fivetechno.de>
> 
> ---
> 
>  drivers/clk/clk-max77686.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
> index b637f5979023..eb953d3b0b69 100644
> --- a/drivers/clk/clk-max77686.c
> +++ b/drivers/clk/clk-max77686.c
> @@ -216,6 +216,7 @@ static int max77686_clk_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> +	drv_data->num_clks = num_clks;
>  	drv_data->max_clk_data = devm_kcalloc(dev, num_clks,
>  					      sizeof(*drv_data->max_clk_data),
>  					      GFP_KERNEL);
> 

Looks good to me.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

-- 
Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration
  2016-10-06 14:59 ` [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration Javier Martinez Canillas
  2016-10-06 17:22   ` Krzysztof Kozlowski
  2016-10-07  0:36   ` Chanwoo Choi
@ 2016-10-17 22:30   ` Stephen Boyd
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2016-10-17 22:30 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: linux-kernel, Markus Reichl, Tobias Jakobi, Michael Turquette,
	Chanwoo Choi, Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski,
	linux-clk

On 10/06, Javier Martinez Canillas wrote:
> The commit 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and
> registration APIs") converted the driver to use the new provider API to
> register clocks using clk_hw.
> 
> But unfortunately, in the conversion it missed to set the num_clks value
> which lead to the following error when trying to register a clk provider:
> 
> [    1.963782] of_clk_max77686_get: invalid index 0
> [    1.967460] ERROR: could not get clock /rtc@10070000:rtc_src(1)
> [    1.973638] s3c-rtc 10070000.rtc: failed to find rtc source clock
> 
> Fix it by correctly set the max77686_clk_driver_data num_clks member.
> 
> Fixes: 9b4cac33adc7 ("clk: max77686: Migrate to clk_hw based OF and registration APIs")
> Reported-by: Markus Reichl <m.reichl@fivetechno.de>
> Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Markus Reichl <m.reichl@fivetechno.de>
> 
> ---

Applied to clk-fixes

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-17 22:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161006150016epcas1p21acf81d53302f6917c38b3a451fcbe07@epcas1p2.samsung.com>
2016-10-06 14:59 ` [PATCH] clk: max77686: fix number of clocks setup for clk_hw based registration Javier Martinez Canillas
2016-10-06 17:22   ` Krzysztof Kozlowski
2016-10-07  0:36   ` Chanwoo Choi
2016-10-17 22:30   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).