mirror of
https://github.com/opnsense/src.git
synced 2026-03-04 06:11:32 -05:00
Handle failure to enable the clock or obtain its frequency.
This commit is contained in:
parent
1bf4afc527
commit
4d7ef8a2be
1 changed files with 8 additions and 0 deletions
|
|
@ -150,8 +150,16 @@ aw_pwm_attach(device_t dev)
|
|||
goto fail;
|
||||
}
|
||||
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);
|
||||
if (error != 0) {
|
||||
device_printf(dev, "cannot get clock frequency\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (bus_alloc_resources(dev, aw_pwm_spec, &sc->res) != 0) {
|
||||
device_printf(dev, "cannot allocate resources for device\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue