Handle failure to enable the clock or obtain its frequency.
This commit is contained in:
parent
1bf4afc527
commit
4d7ef8a2be
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349060
@ -150,8 +150,16 @@ aw_pwm_attach(device_t dev)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
error = clk_enable(sc->clk);
|
error = clk_enable(sc->clk);
|
||||||
|
if (error != 0) {
|
||||||
|
device_printf(dev, "cannot enable clock\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
error = clk_get_freq(sc->clk, &sc->clk_freq);
|
error = clk_get_freq(sc->clk, &sc->clk_freq);
|
||||||
|
if (error != 0) {
|
||||||
|
device_printf(dev, "cannot get clock frequency\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (bus_alloc_resources(dev, aw_pwm_spec, &sc->res) != 0) {
|
if (bus_alloc_resources(dev, aw_pwm_spec, &sc->res) != 0) {
|
||||||
device_printf(dev, "cannot allocate resources for device\n");
|
device_printf(dev, "cannot allocate resources for device\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user