]> git.baikalelectronics.ru Git - kernel.git/commitdiff
genirq: Don't return error on missing optional irq_request_resources()
authorAntonio Borneo <antonio.borneo@foss.st.com>
Thu, 12 May 2022 16:05:44 +0000 (18:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:29 +0000 (11:17 +0200)
[ Upstream commit c88a4246922518260464857e37f812e665d6adf5 ]

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@foss.st.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220512160544.13561-1-antonio.borneo@foss.st.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/irq/chip.c

index 856f0297dc7382d368b0c141774dc1394dcef5ef..521121c2666ce5a0583701ab4205763be5aeddee 100644 (file)
@@ -1484,7 +1484,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);