Skip to contentSkip to conversation

crypto: aspeed: Propagate platform_get_irq() errors

PATCH In review Narasimharao Vadlamudi 2 participants 2 messages Jul 10 – Jul 17

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: aspeed: Propagate platform_get_irq() errors

platform_get_irq() returns a positive IRQ number on success and a negative error code on failure. aspeed_acry_probe() and aspeed_hace_probe() already detect negative returns, but both convert every failure to -ENXIO.

Return the original error code so callers can handle errors such as -EPROBE_DEFER correctly.

Fixes 2f1cf4e50c95 ("crypto: aspeed - Add ACRY RSA driver")
Fixes 70513e1d6559 ("crypto: aspeed - Fix check for platform_get_irq() errors")
---
 drivers/crypto/aspeed/aspeed-acry.c | 2 +-
 drivers/crypto/aspeed/aspeed-hace.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/aspeed/aspeed-acry.c +1 -1
index 5993bcba9716..301612556a76 100644
@@ -728,7 +728,7 @@ static int aspeed_acry_probe(struct platform_device *pdev)
 	/* Get irq number and register it */
 	acry_dev->irq = platform_get_irq(pdev, 0);
 	if (acry_dev->irq < 0)
-		return -ENXIO;
+		return acry_dev->irq;
 
 	rc = devm_request_irq(dev, acry_dev->irq, aspeed_acry_irq, 0,
 			      dev_name(dev), acry_dev);
drivers/crypto/aspeed/aspeed-hace.c +1 -1
index 3fe644bfe037..1f9afa002ae8 100644
@@ -127,7 +127,7 @@ static int aspeed_hace_probe(struct platform_device *pdev)
 	/* Get irq number and register it */
 	hace_dev->irq = platform_get_irq(pdev, 0);
 	if (hace_dev->irq < 0)
-		return -ENXIO;
+		return hace_dev->irq;
 
 	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
 			      dev_name(&pdev->dev), hace_dev);
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 7 lines · Narasimharao Vadlamudi

platform_get_irq() returns a positive IRQ number on success and a negative error code on failure. aspeed_acry_probe() and aspeed_hace_probe() already detect negative returns, but both convert every failure to -ENXIO.

Return the original error code so callers can handle errors such as -EPROBE_DEFER correctly.

Quoted 7 lines
Fixes 2f1cf4e50c95 ("crypto: aspeed - Add ACRY RSA driver")
Fixes 70513e1d6559 ("crypto: aspeed - Fix check for platform_get_irq() errors")
---
 drivers/crypto/aspeed/aspeed-acry.c | 2 +-
 drivers/crypto/aspeed/aspeed-hace.c | 2 +-
 2 files changed, 2 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