summaryrefslogtreecommitdiff
path: root/drivers/clk/meson
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2017-03-28 11:47:22 +0300
committerJerome Brunet <jbrunet@baylibre.com>2017-04-07 17:50:44 +0300
commita70c6e06ed7c8c84612c7e3dada9d6895b65c70a (patch)
tree0ab74266ff4fa3a9adf4416722e7ea0b11f0332b /drivers/clk/meson
parentfd33f3eca6bfb0bba9b928ba28a6c6c16f7243ad (diff)
downloadlinux-a70c6e06ed7c8c84612c7e3dada9d6895b65c70a.tar.xz
clk: meson: gxbb: protect against holes in the onecell_data array
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>
Diffstat (limited to 'drivers/clk/meson')
-rw-r--r--drivers/clk/meson/gxbb.c4
1 files changed, 4 insertions, 0 deletions
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)