linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chunyan Zhang <zhang.chunyan@linaro.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	Baolin Wang <baolin.wang@linaro.org>
Subject: Re: [PATCH 7/9] clk: sprd: Don't reference clk_init_data after registration
Date: Fri, 2 Aug 2019 09:57:05 +0800	[thread overview]
Message-ID: <CAG2=9p9bhEpWRAEWPsqwyEGAm4xeRtJmh1dQCvA808SPmiAR5Q@mail.gmail.com> (raw)
In-Reply-To: <20190731193517.237136-8-sboyd@kernel.org>

On Thu, 1 Aug 2019 at 03:35, Stephen Boyd <sboyd@kernel.org> 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: Chunyan Zhang <zhang.chunyan@linaro.org>
> Cc: Baolin Wang <baolin.wang@linaro.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
>
> Please ack so I can take this through clk tree

Acked-by: Chunyan Zhang <zhang.chunyan@linaro.org>

Thanks.

>
>  drivers/clk/sprd/common.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c
> index a5bdca1de5d0..9d56eac43832 100644
> --- a/drivers/clk/sprd/common.c
> +++ b/drivers/clk/sprd/common.c
> @@ -76,16 +76,17 @@ int sprd_clk_probe(struct device *dev, struct clk_hw_onecell_data *clkhw)
>         struct clk_hw *hw;
>
>         for (i = 0; i < clkhw->num; i++) {
> +               const char *name;
>
>                 hw = clkhw->hws[i];
> -
>                 if (!hw)
>                         continue;
>
> +               name = hw->init->name;
>                 ret = devm_clk_hw_register(dev, hw);
>                 if (ret) {
>                         dev_err(dev, "Couldn't register clock %d - %s\n",
> -                               i, hw->init->name);
> +                               i, name);
>                         return ret;
>                 }
>         }
> --
> Sent by a computer through tubes
>

  parent reply	other threads:[~2019-08-02  1:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 19:35 [PATCH 0/9] Make clk_hw::init NULL after clk registration Stephen Boyd
2019-07-31 19:35 ` [PATCH 1/9] clk: actions: Don't reference clk_init_data after registration Stephen Boyd
2019-08-03 12:48   ` Manivannan Sadhasivam
2019-08-14  0:24   ` Stephen Boyd
2019-08-16 11:22   ` Manivannan Sadhasivam
2019-08-16 14:50     ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 2/9] clk: lochnagar: " Stephen Boyd
2019-08-01  8:07   ` Charles Keepax
2019-08-14  0:24   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 3/9] clk: meson: axg-audio: " Stephen Boyd
2019-07-31 19:53   ` Neil Armstrong
2019-08-06  8:49   ` Jerome Brunet
2019-08-06 21:48     ` Stephen Boyd
2019-08-07 13:57       ` Jerome Brunet
2019-08-14  0:24   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 4/9] clk: qcom: " Stephen Boyd
2019-08-04 17:49   ` Taniya Das
2019-08-14  0:24   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 5/9] clk: sirf: " Stephen Boyd
2019-08-14  0:25   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 6/9] clk: socfpga: " Stephen Boyd
2019-08-01 15:12   ` Dinh Nguyen
2019-08-01 16:13     ` Stephen Boyd
2019-08-14  0:25   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 7/9] clk: sprd: " Stephen Boyd
2019-08-01  7:41   ` Baolin Wang
2019-08-02  1:57   ` Chunyan Zhang [this message]
2019-08-14  0:25   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 8/9] phy: ti: am654-serdes: " Stephen Boyd
2019-08-02 12:45   ` Kishon Vijay Abraham I
2019-08-14  0:25   ` Stephen Boyd
2019-07-31 19:35 ` [PATCH 9/9] clk: Overwrite clk_hw::init with NULL during clk_register() Stephen Boyd
2019-08-08 16:14   ` Sylwester Nawrocki
2019-08-14  0:25   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG2=9p9bhEpWRAEWPsqwyEGAm4xeRtJmh1dQCvA808SPmiAR5Q@mail.gmail.com' \
    --to=zhang.chunyan@linaro.org \
    --cc=baolin.wang@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --subject='Re: [PATCH 7/9] clk: sprd: Don'\''t reference clk_init_data after registration' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).