pinctrl/sun4i: Fix race in installing chained IRQ handler
pinctrl/sun4i: Fix race in installing chained IRQ handler

Fix a race where a pending interrupt could be received and the handler
called before the handler's data has been setup, by converting to
irq_set_chained_handler_and_data().

Search and conversion was done with coccinelle:

@@
expression E1, E2, E3;
@@
(
-if (irq_set_chained_handler(E1, E3) != 0)
-   BUG();
|
-irq_set_chained_handler(E1, E3);
)
-irq_set_handler_data(E1, E2);
+irq_set_chained_handler_and_data(E1, E3, E2);

@@
expression E1, E2, E3;
@@
(
-if (irq_set_chained_handler(E1, E3) != 0)
-   BUG();
...
|
-irq_set_chained_handler(E1, E3);
...
)
-irq_set_handler_data(E1, E2);
+irq_set_chained_handler_and_data(E1, E3, E2);

Reported-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: Julia Lawall <3d4a3affaf9163789962e9770780389962bda29d@lip6.fr>
Cc: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>
Cc: Maxime Ripard <2d324f4ca95610bde432fa2af2f28cd21110687d@free-electrons.com>
Cc: Hans de Goede <9fa1be1a5b5729e4c6b404f34c9ce49ff4882fd8@redhat.com>
Cc: Chen-Yu Tsai <11e8bbde1bc9e0af703df23be02afe58864a4a18@csie.org>
Cc: Fan Wu <127e1b5a5d5f4b1cdca089991876a4b75674b751@marvell.com>
Cc: abdoulaye berthe <f124635d53a8238fab81835f7d49971b7b63e95e@gmail.com>
Cc: Alexandre Courbot <301cd6a3ea50a894b4b51e385c5eb12b9a4ffc0c@nvidia.com>
Cc: 566578396a3687944c2f0ec2d93d3fcd41719bb0@vger.kernel.org
Cc: f99ef57ccac738b558d0fc2e44478b3c5def9522@lists.infradead.org

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs