Linux clock framework development
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Carlo Caione <carlo@caione.org>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v1 2/8] clk: meson: gxbb: protect against holes in the onecell_data array
Date: Tue, 28 Mar 2017 16:45:59 +0200	[thread overview]
Message-ID: <20170328144605.25278-3-jbrunet@baylibre.com> (raw)
In-Reply-To: <20170328144605.25278-1-jbrunet@baylibre.com>


The clock controller is getting more complex and it might be possible, in
the future, to have holes in the clk_hw_onecell_data array. Just make sure
we skip those holes if it ever happens.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/meson/gxbb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
index 75197664a7ee..28812ea41a60 100644
--- a/drivers/clk/meson/gxbb.c
+++ b/drivers/clk/meson/gxbb.c
@@ -1388,6 +1388,10 @@ static int gxbb_clkc_probe(struct platform_device *pdev)
 	 * register all clks
 	 */
 	for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) {
+		/* array might be sparse */
+		if (!clkc_data->hw_onecell_data->hws[clkid])
+			continue;
+
 		ret = devm_clk_hw_register(dev,
 					clkc_data->hw_onecell_data->hws[clkid]);
 		if (ret)
-- 
2.9.3

  parent reply	other threads:[~2017-03-28 14:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 14:45 [PATCH v1 0/8] clk: meson: gxbb: more clock controller update for audio support Jerome Brunet
2017-03-28 14:45 ` [PATCH v1 1/8] dt-bindings: clock: gxbb: expose spdif clock gates Jerome Brunet
2017-03-28 14:45 ` Jerome Brunet [this message]
2017-03-28 14:46 ` [PATCH v1 3/8] clk: meson: add audio clock divider support Jerome Brunet
2017-03-28 14:58   ` Hendrik v. Raven
2017-03-28 15:26     ` Jerome Brunet
2017-03-28 14:46 ` [PATCH v1 4/8] clk: meson: gxbb: add cts_amclk Jerome Brunet
2017-03-28 14:46 ` [PATCH v1 5/8] clk: meson: gxbb: add cts_mclk_i958 Jerome Brunet
2017-03-28 14:46 ` [PATCH v1 6/8] clk: meson: gxbb: add cts_i958 clock Jerome Brunet
2017-03-28 14:46 ` [PATCH v1 7/8] dt-bindings: clock: gxbb: expose i2s master clock Jerome Brunet
2017-03-28 14:46 ` [PATCH v1 8/8] dt-bindings: clock: gxbb: expose spdif " Jerome Brunet
2017-03-29 20:42 ` [PATCH v1 0/8] clk: meson: gxbb: more clock controller update for audio support Michael Turquette
2017-03-30  8:15   ` Neil Armstrong

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=20170328144605.25278-3-jbrunet@baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=carlo@caione.org \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox