allwiner: modclk: Do not try to enable parent clock if it doesn't exist

This commit is contained in:
Emmanuel Vadot 2017-08-02 20:17:04 +00:00
parent 4d00943ae4
commit 904581f050
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=321941

View File

@ -89,7 +89,10 @@ aw_modclk_init(struct clknode *clk, device_t dev)
index = (val & CLK_SRC_SEL) >> CLK_SRC_SEL_SHIFT;
clknode_init_parent_idx(clk, index);
if (index <= clknode_get_parents_num(clk))
clknode_init_parent_idx(clk, index);
else
clknode_init_parent_idx(clk, 0);
return (0);
}