[irqchip: irq/irqchip-next] genirq: Don't return error on missing optional irq_request_resources()

From: irqchip-bot for Antonio Borneo
Date: Thu Jul 07 2022 - 04:18:45 EST


The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID: 95001b756467ecc9f5973eb5e74e97699d9bbdf1
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/95001b756467ecc9f5973eb5e74e97699d9bbdf1
Author: Antonio Borneo <antonio.borneo@xxxxxxxxxxx>
AuthorDate: Thu, 12 May 2022 18:05:44 +02:00
Committer: Marc Zyngier <maz@xxxxxxxxxx>
CommitterDate: Thu, 07 Jul 2022 09:04:13 +01:00

genirq: Don't return error on missing optional irq_request_resources()

Function irq_chip::irq_request_resources() is reported as optional
in the declaration of struct irq_chip.
If the parent irq_chip does not implement it, we should ignore it
and return.

Don't return error if the functions is missing.

Signed-off-by: Antonio Borneo <antonio.borneo@xxxxxxxxxxx>
Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20220512160544.13561-1-antonio.borneo@xxxxxxxxxxx
---
kernel/irq/chip.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 886789d..c190405 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1516,7 +1516,8 @@ int irq_chip_request_resources_parent(struct irq_data *data)
if (data->chip->irq_request_resources)
return data->chip->irq_request_resources(data);

- return -ENOSYS;
+ /* no error on missing optional irq_chip::irq_request_resources */
+ return 0;
}
EXPORT_SYMBOL_GPL(irq_chip_request_resources_parent);