serial: ns16550: check return of clock_control_get_rate()
This adds a check of the return of clock_control_get_rate(), and returns error in uart_configure() if unsuccessful in getting clock rate. Fixes #60478 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
a8b103e4ad
commit
20021abf0a
1 changed files with 6 additions and 2 deletions
|
@ -458,8 +458,12 @@ static int uart_ns16550_configure(const struct device *dev,
|
|||
goto out;
|
||||
}
|
||||
|
||||
clock_control_get_rate(dev_cfg->clock_dev, dev_cfg->clock_subsys,
|
||||
&pclk);
|
||||
if (clock_control_get_rate(dev_cfg->clock_dev,
|
||||
dev_cfg->clock_subsys,
|
||||
&pclk) != 0) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
set_baud_rate(dev, cfg->baudrate, pclk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue