Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1614001
| From | Jerome Brunet <jbrunet@baylibre.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 2/8] clk: meson: gxbb: protect against holes in the onecell_data array |
| Date | 2017-03-31 15:10 +0200 |
| Message-ID | <tr4ts-52J-27@gated-at.bofh.it> (permalink) |
| References | <tr4tr-52J-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Acked-by: Michael Turquette <mturquette@baylibre.com>
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/8] clk: meson: gxbb: more clock controller update for audio support Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 1/8] dt-bindings: clock: gxbb: expose spdif clock gates Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 3/8] clk: meson: add audio clock divider support Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 2/8] clk: meson: gxbb: protect against holes in the onecell_data array Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 4/8] clk: meson: gxbb: add cts_amclk Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 5/8] clk: meson: gxbb: add cts_mclk_i958 Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 6/8] clk: meson: gxbb: add cts_i958 clock Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200 [PATCH v2 7/8] dt-bindings: clock: gxbb: expose i2s master clock Jerome Brunet <jbrunet@baylibre.com> - 2017-03-31 15:10 +0200
csiph-web