]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: amcc - convert irq_of_parse_and_map to platform_get_irq
authorRosen Penev <rosenp@gmail.com>
Tue, 2 Jun 2026 01:46:45 +0000 (18:46 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Jun 2026 01:56:45 +0000 (09:56 +0800)
Replace the deprecated irq_of_parse_and_map() call with the modern
platform_get_irq() in the probe function. This also improves error
handling: platform_get_irq() returns a negative errno on failure,
whereas irq_of_parse_and_map() returned 0.

Change the irq field in struct crypto4xx_core_device from u32 to int
to match the return type of platform_get_irq().

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/amcc/crypto4xx_core.c
drivers/crypto/amcc/crypto4xx_core.h

index 68c5ff7a85b4f9934cfc6e61714e1520317bc0c8..001da785af07968c6d765cbc558e56efa06d2ee0 100644 (file)
@@ -1294,7 +1294,11 @@ static int crypto4xx_probe(struct platform_device *ofdev)
        }
 
        /* Register for Crypto isr, Crypto Engine IRQ */
-       core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+       core_dev->irq = platform_get_irq(ofdev, 0);
+       if (core_dev->irq < 0) {
+               rc = core_dev->irq;
+               goto err_iomap;
+       }
        rc = devm_request_irq(&ofdev->dev, core_dev->irq,
                              is_revb ? crypto4xx_ce_interrupt_handler_revb :
                                        crypto4xx_ce_interrupt_handler,
index 3a028aec3f0c158286edbea097d91e4d6aeec81d..66a95733c86dd23d4753fd7c6fcb3cf437451616 100644 (file)
@@ -106,7 +106,7 @@ struct crypto4xx_core_device {
        struct crypto4xx_device *dev;
        struct hwrng *trng;
        u32 int_status;
-       u32 irq;
+       int irq;
        struct tasklet_struct tasklet;
        spinlock_t lock;
 };