drivers: serial: check if clock device is ready before accessing
Add check for device_is_ready() before accessing clock control devices. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
78dd25e79e
commit
9456eca5c0
13 changed files with 52 additions and 1 deletions
|
@ -377,7 +377,7 @@ static int uart_ns16550_configure(const struct device *dev,
|
|||
if (dev_cfg->sys_clk_freq != 0U) {
|
||||
pclk = dev_cfg->sys_clk_freq;
|
||||
} else {
|
||||
if (dev_cfg->clock_dev == NULL) {
|
||||
if (!device_is_ready(dev_cfg->clock_dev)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue