Re: [PATCH 6/9] clk: socfpga: Don't reference clk_init_data after registration

From: Stephen Boyd
Date: Thu Aug 01 2019 - 12:13:24 EST


Quoting Dinh Nguyen (2019-08-01 08:12:58)
> Hi Stephen,
>
> On 7/31/19 2:35 PM, Stephen Boyd wrote:
> > A future patch is going to change semantics of clk_register() so that
> > clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
> > referencing this member here so that we don't run into NULL pointer
> > exceptions.
> >
> > Cc: Dinh Nguyen <dinguyen@xxxxxxxxxx>
> > Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
> > ---
> >
> > Please ack so I can take this through clk tree
> >
> > drivers/clk/socfpga/clk-gate.c | 21 +++++++++++----------
> > drivers/clk/socfpga/clk-periph-a10.c | 7 ++++---
> > 2 files changed, 15 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c
> > index 3966cd43b552..b3c8143909dc 100644
> > --- a/drivers/clk/socfpga/clk-gate.c
> > +++ b/drivers/clk/socfpga/clk-gate.c
> > @@ -31,20 +31,20 @@ static u8 socfpga_clk_get_parent(struct clk_hw *hwclk)
> > u32 l4_src;
> > u32 perpll_src;
>
> You need this line here:
>
> const char *name = clk_hw_get_name(hwclk);
>
> Otherwise, it fails to build. With the above change:
>
> Acked-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>

Awesome thanks!