Skip to contentSkip to conversation

crypto: amcc - convert irq_of_parse_and_map to platform_get_irq

PATCH In review Rosen Penev 2 participants 2 messages Jun 2 – Jun 11 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: amcc - convert irq_of_parse_and_map to platform_get_irq

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
---
 drivers/crypto/amcc/crypto4xx_core.c | 6 +++++-
 drivers/crypto/amcc/crypto4xx_core.h | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/crypto/amcc/crypto4xx_core.c +5 -1
index b7b6c97d2147..063282a2ad63 100644
@@ -1382,7 +1382,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,
drivers/crypto/amcc/crypto4xx_core.h +1 -1
index ee36630c670f..391475d00bdb 100644
@@ -108,7 +108,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;
 	struct mutex rng_lock;
Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 8 lines · Rosen Penev

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().

Quoted 6 lines
Assisted-by opencode:big-pickle
---
 drivers/crypto/amcc/crypto4xx_core.c | 6 +++++-
 drivers/crypto/amcc/crypto4xx_core.h | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt