Patch "gpio: mxc: Only get the second IRQ when there is more than one IRQ" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gpio: mxc: Only get the second IRQ when there is more than one IRQ

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpio-mxc-only-get-the-second-irq-when-there-is-more-.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c16b1eda3c3cf6697a5f0c84800b5158ca277b61
Author: Anson Huang <Anson.Huang@xxxxxxx>
Date:   Thu Sep 19 17:39:17 2019 +0800

    gpio: mxc: Only get the second IRQ when there is more than one IRQ
    
    [ Upstream commit c8f3d144004dd3f471ffd414690d15a005e4acd6 ]
    
    On some of i.MX SoCs like i.MX8QXP, there is ONLY one IRQ for each
    GPIO bank, so it is better to check the IRQ count before getting
    second IRQ to avoid below error message during probe:
    
    [    1.070908] gpio-mxc 5d080000.gpio: IRQ index 1 not found
    [    1.077420] gpio-mxc 5d090000.gpio: IRQ index 1 not found
    [    1.083766] gpio-mxc 5d0a0000.gpio: IRQ index 1 not found
    [    1.090122] gpio-mxc 5d0b0000.gpio: IRQ index 1 not found
    [    1.096470] gpio-mxc 5d0c0000.gpio: IRQ index 1 not found
    [    1.102804] gpio-mxc 5d0d0000.gpio: IRQ index 1 not found
    [    1.109144] gpio-mxc 5d0e0000.gpio: IRQ index 1 not found
    [    1.115475] gpio-mxc 5d0f0000.gpio: IRQ index 1 not found
    
    Signed-off-by: Anson Huang <Anson.Huang@xxxxxxx>
    Signed-off-by: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 7907a8755866..c77d474185f3 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -411,6 +411,7 @@ static int mxc_gpio_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct mxc_gpio_port *port;
+	int irq_count;
 	int irq_base;
 	int err;
 
@@ -426,9 +427,15 @@ static int mxc_gpio_probe(struct platform_device *pdev)
 	if (IS_ERR(port->base))
 		return PTR_ERR(port->base);
 
-	port->irq_high = platform_get_irq(pdev, 1);
-	if (port->irq_high < 0)
-		port->irq_high = 0;
+	irq_count = platform_irq_count(pdev);
+	if (irq_count < 0)
+		return irq_count;
+
+	if (irq_count > 1) {
+		port->irq_high = platform_get_irq(pdev, 1);
+		if (port->irq_high < 0)
+			port->irq_high = 0;
+	}
 
 	port->irq = platform_get_irq(pdev, 0);
 	if (port->irq < 0)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux