MLK-9769-23 Replace SECVIO of_irq_to_resource() with irq_of_parse_and_map()
authorVictoria Milhoan <vicki.milhoan@freescale.com>
Wed, 14 Jan 2015 18:43:12 +0000 (11:43 -0700)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:55 +0000 (14:49 -0500)
Replace of_irq_to_resource() in the SECVIO module with the simpler
equivalent irq_of_parse_and_map().  Also, add error checking to
to the SECVIO and Job Ring modules. Based on upstream commit
f7578496a671a96e501f16a5104893275e32c33a.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
drivers/crypto/caam/jr.c
drivers/crypto/caam/secvio.c

index e39fd7c..0a88728 100644 (file)
@@ -507,6 +507,10 @@ static int caam_jr_probe(struct platform_device *pdev)
 
        /* Identify the interrupt */
        jrpriv->irq = irq_of_parse_and_map(nprop, 0);
+       if (jrpriv->irq <= 0) {
+               kfree(jrpriv);
+               return -EINVAL;
+       }
 
        /* Now do the platform independent part */
        error = caam_jr_init(jrdev); /* now turn on hardware */
index 9ed389a..86e4fc4 100644 (file)
@@ -214,7 +214,11 @@ static int snvs_secvio_probe(struct platform_device *pdev)
                kfree(svpriv);
                return -EINVAL;
        }
-       svpriv->irq = of_irq_to_resource(npirq, 0, NULL);
+       svpriv->irq = irq_of_parse_and_map(npirq, 0);
+       if (svpriv->irq <= 0) {
+               kfree(svpriv);
+               return -EINVAL;
+       }
 
        snvsregs = of_iomap(np, 0);
        if (!snvsregs) {