Skip to contentSkip to conversation

crypto: mv_cesa: remove NO_IRQ reference

PATCH In review Arnd Bergmann 3 participants 3 messages Sep 2, 2016 – Sep 7, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: mv_cesa: remove NO_IRQ reference

Drivers should not use NO_IRQ, as we are trying to get rid of that. In this case, the call to irq_of_parse_and_map() is both wrong (as it returns '0' on failure, not NO_IRQ) and unnecessary (as platform_get_irq() does the same thing)

This removes the call to irq_of_parse_and_map() and checks for the error code correctly.

---
 drivers/crypto/mv_cesa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

It would be good if someone could test this on a machine that boots from DT to ensure the conversion was correct.

drivers/crypto/mv_cesa.c +2 -5
index e6b658faef63..104e9ce9400a 100644
@@ -1091,11 +1091,8 @@ static int mv_probe(struct platform_device *pdev)
 
 	cp->max_req_size = cp->sram_size - SRAM_CFG_SPACE;
 
-	if (pdev->dev.of_node)
-		irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
-	else
-		irq = platform_get_irq(pdev, 0);
-	if (irq < 0 || irq == NO_IRQ) {
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
 		ret = irq;
 		goto err;
 	}
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Sat, 3 Sep 2016 01:26:40 +0200 Arnd Bergmann <[email protected]> wrote:

Drivers should not use NO_IRQ, as we are trying to get rid of that. In this case, the call to irq_of_parse_and_map() is both wrong (as it returns '0' on failure, not NO_IRQ) and unnecessary (as platform_get_irq() does the same thing)

This removes the call to irq_of_parse_and_map() and checks for the error code correctly.

Quoted 25 lines
---
 drivers/crypto/mv_cesa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

It would be good if someone could test this on a machine that boots from DT to ensure the conversion was correct.

drivers/crypto/mv_cesa.c +2 -5
index e6b658faef63..104e9ce9400a 100644
@@ -1091,11 +1091,8 @@ static int mv_probe(struct platform_device *pdev)
 
 	cp->max_req_size = cp->sram_size - SRAM_CFG_SPACE;
 
-	if (pdev->dev.of_node)
-		irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
-	else
-		irq = platform_get_irq(pdev, 0);
-	if (irq < 0 || irq == NO_IRQ) {
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
 		ret = irq;
 		goto err;
 	}
maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

Drivers should not use NO_IRQ, as we are trying to get rid of that. In this case, the call to irq_of_parse_and_map() is both wrong (as it returns '0' on failure, not NO_IRQ) and unnecessary (as platform_get_irq() does the same thing)

This removes the call to irq_of_parse_and_map() and checks for the error code correctly.

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