From dedd444fb70eee203a1bfdaf275a67263c00cd14 Mon Sep 17 00:00:00 2001 From: Thomas Stranger Date: Sun, 28 Mar 2021 18:07:56 +0200 Subject: [PATCH] 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 --- drivers/interrupt_controller/Kconfig.shared_irq | 9 --------- drivers/interrupt_controller/intc_shared_irq.c | 7 +++++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/interrupt_controller/Kconfig.shared_irq b/drivers/interrupt_controller/Kconfig.shared_irq index 9e542212821..ab7c060546b 100644 --- a/drivers/interrupt_controller/Kconfig.shared_irq +++ b/drivers/interrupt_controller/Kconfig.shared_irq @@ -9,15 +9,6 @@ menuconfig SHARED_IRQ Include shared interrupt support in system. Shared interrupt support is NOT required in most systems. If in doubt answer no. -config SHARED_IRQ_NUM_CLIENTS - int "The number of clients per instance" - depends on SHARED_IRQ - default 5 - help - Configures the maximum number of clients allowed per shared - instance of the shared interrupt driver. To conserve RAM set - this value to the lowest practical value. - config SHARED_IRQ_INIT_PRIORITY int "Shared IRQ init priority" depends on SHARED_IRQ diff --git a/drivers/interrupt_controller/intc_shared_irq.c b/drivers/interrupt_controller/intc_shared_irq.c index ae857a3d3f3..c210897e5d5 100644 --- a/drivers/interrupt_controller/intc_shared_irq.c +++ b/drivers/interrupt_controller/intc_shared_irq.c @@ -33,7 +33,7 @@ struct shared_irq_client { }; struct shared_irq_runtime { - struct shared_irq_client client[CONFIG_SHARED_IRQ_NUM_CLIENTS]; + struct shared_irq_client *const client; }; /** @@ -164,7 +164,10 @@ void shared_irq_config_func_##n(void) \ #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), \