Set denominator to 1 if it is 0 in the init phase.
This prevents panic and also helps when the clocks become available later. This is based on comment from manu@ on https://reviews.freebsd.org/D31299
This commit is contained in:
parent
f341e9bad3
commit
8eb94b238f
@ -150,6 +150,8 @@ rk_clk_fract_init(struct clknode *clk, device_t dev)
|
|||||||
|
|
||||||
sc->numerator = (reg >> 16) & 0xFFFF;
|
sc->numerator = (reg >> 16) & 0xFFFF;
|
||||||
sc->denominator = reg & 0xFFFF;
|
sc->denominator = reg & 0xFFFF;
|
||||||
|
if (sc->denominator == 0)
|
||||||
|
sc->denominator = 1;
|
||||||
clknode_init_parent_idx(clk, 0);
|
clknode_init_parent_idx(clk, 0);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user