mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
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>
This commit is contained in:
parent
fd33f3eca6
commit
a70c6e06ed
@ -1388,6 +1388,10 @@ static int gxbb_clkc_probe(struct platform_device *pdev)
|
|||||||
* register all clks
|
* register all clks
|
||||||
*/
|
*/
|
||||||
for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) {
|
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,
|
ret = devm_clk_hw_register(dev,
|
||||||
clkc_data->hw_onecell_data->hws[clkid]);
|
clkc_data->hw_onecell_data->hws[clkid]);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user