From: Jerome Brunet Date: Tue, 28 Mar 2017 08:47:22 +0000 (+0200) Subject: clk: meson: gxbb: protect against holes in the onecell_data array X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a70c6e06ed7c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Jerome Brunet --- 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)