mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
drivers: intc: 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:
committed by
Carles Cufí
parent
2e1f25f355
commit
5a7eb0ccfc
@@ -515,6 +515,10 @@ static int xec_ecia_init(const struct device *dev)
|
||||
uint32_t n = 0, nr = 0;
|
||||
int ret;
|
||||
|
||||
if (!device_is_ready(clk_dev)) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = clock_control_on(clk_dev,
|
||||
(clock_control_subsys_t *)&cfg->clk_ctrl);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -154,6 +154,10 @@ static int rv32m1_intmux_init(const struct device *dev)
|
||||
INTMUX_Type *regs = DEV_REGS(dev);
|
||||
size_t i;
|
||||
|
||||
if (!device_is_ready(config->clock_dev)) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Enable INTMUX clock. */
|
||||
clock_control_on(config->clock_dev, config->clock_subsys);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user