summaryrefslogtreecommitdiffstats
path: root/drivers/clk/meson/gxbb.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2017-03-28 10:47:22 +0200
committerJerome Brunet <jbrunet@baylibre.com>2017-04-07 16:50:44 +0200
commita70c6e06ed7c8c84612c7e3dada9d6895b65c70a (patch)
tree0ab74266ff4fa3a9adf4416722e7ea0b11f0332b /drivers/clk/meson/gxbb.c
parentMAINTAINERS: Add maintainers for the meson clock driver (diff)
downloadlinux-a70c6e06ed7c8c84612c7e3dada9d6895b65c70a.tar.xz
linux-a70c6e06ed7c8c84612c7e3dada9d6895b65c70a.zip
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 '')
-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)