drivers: interrupt_controller: intc_shared: clients array size from dts
The size of the array holding the client information is determined
from the number of dt supports dep ordinals.
Finally remove the Kconfig symbol for the number of clients.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
diff --git a/drivers/interrupt_controller/intc_shared_irq.c b/drivers/interrupt_controller/intc_shared_irq.c
index ae857a3..c210897 100644
--- a/drivers/interrupt_controller/intc_shared_irq.c
+++ b/drivers/interrupt_controller/intc_shared_irq.c
@@ -33,7 +33,7 @@
};
struct shared_irq_runtime {
- struct shared_irq_client client[CONFIG_SHARED_IRQ_NUM_CLIENTS];
+ struct shared_irq_client *const client;
};
/**
@@ -164,7 +164,10 @@
#define SHARED_IRQ_INIT(n) \
SHARED_IRQ_CONFIG_FUNC(n) \
- struct shared_irq_runtime shared_irq_data_##n; \
+ struct shared_irq_client clients_##n[INST_SUPPORTS_DEP_ORDS_CNT(n)]; \
+ struct shared_irq_runtime shared_irq_data_##n = { \
+ .client = clients_##n \
+ }; \
\
const struct shared_irq_config shared_irq_config_##n = { \
.irq_num = DT_INST_IRQN(n), \