[U-Boot,i.MX8MM+CCF,02/41] clk: fixed-factor: fix get clk_fixed_factor
diff mbox series

Message ID 20190430103056.32537-3-peng.fan@nxp.com
State Superseded
Delegated to: Stefano Babic
Headers show
Series
  • i.MX8MM + CCF
Related show

Commit Message

Peng Fan April 30, 2019, 10:17 a.m. UTC
driver data is not clk, not clk_fixed_factor, fix it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/clk-fixed-factor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lukasz Majewski May 6, 2019, 9:41 p.m. UTC | #1
On Tue, 30 Apr 2019 10:17:36 +0000
Peng Fan <peng.fan@nxp.com> wrote:

> driver data is not clk, not clk_fixed_factor, fix it.

This description is a bit misleading, IMHO.

The dev->driver_data holds pointer to corresponding struct clk clk
element (as described [1]).
 
This patch resembles changes from PATCH [1/42].

> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/clk/clk-fixed-factor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-fixed-factor.c
> b/drivers/clk/clk-fixed-factor.c index acbc0909b4..c535aadc48 100644
> --- a/drivers/clk/clk-fixed-factor.c
> +++ b/drivers/clk/clk-fixed-factor.c
> @@ -19,7 +19,7 @@
>  static ulong clk_factor_recalc_rate(struct clk *clk)
>  {
>  	struct clk_fixed_factor *fix =
> -		(struct clk_fixed_factor
> *)dev_get_driver_data(clk->dev);
> +		to_clk_fixed_factor((struct clk
> *)dev_get_driver_data(clk->dev)); unsigned long parent_rate =
> clk_get_parent_rate(clk); unsigned long long int rate;
>  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

Patch
diff mbox series

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index acbc0909b4..c535aadc48 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -19,7 +19,7 @@ 
 static ulong clk_factor_recalc_rate(struct clk *clk)
 {
 	struct clk_fixed_factor *fix =
-		(struct clk_fixed_factor *)dev_get_driver_data(clk->dev);
+		to_clk_fixed_factor((struct clk *)dev_get_driver_data(clk->dev));
 	unsigned long parent_rate = clk_get_parent_rate(clk);
 	unsigned long long int rate;