Skip to contentSkip to conversation

crypto: amcc: pass core_dev to request_irq

PATCH In review Rosen Penev 2 participants 2 messages Aug 12 – Sep 4 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: amcc: pass core_dev to request_irq

Instead of using a get_drvdata function to get the proper struct, just pass the proper thing directly.

Assisted-by opencode:big-pickle
---
 drivers/crypto/amcc/crypto4xx_core.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/crypto/amcc/crypto4xx_core.c +4 -5
index bbc5162178f5..88d52e4a947e 100644
@@ -1057,8 +1057,7 @@ static void crypto4xx_bh_tasklet_cb(unsigned long data)
 static inline irqreturn_t crypto4xx_interrupt_handler(int irq, void *data,
 						      u32 clr_val)
 {
-	struct device *dev = data;
-	struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
+	struct crypto4xx_core_device *core_dev = data;
 
 	writel(clr_val, core_dev->dev->ce_base + CRYPTO4XX_INT_CLR);
 	tasklet_schedule(&core_dev->tasklet);
@@ -1314,7 +1313,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
 	rc = request_irq(core_dev->irq,
 			 is_revb ? crypto4xx_ce_interrupt_handler_revb :
 				   crypto4xx_ce_interrupt_handler,
-			 0, KBUILD_MODNAME, dev);
+			 0, KBUILD_MODNAME, core_dev);
 	if (rc)
 		goto err_tasklet;
 
@@ -1331,7 +1330,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
 	return 0;
 
 err_irq:
-	free_irq(core_dev->irq, dev);
+	free_irq(core_dev->irq, core_dev);
 err_tasklet:
 	tasklet_kill(&core_dev->tasklet);
 err_build_sdr:
@@ -1352,7 +1351,7 @@ static void crypto4xx_remove(struct platform_device *ofdev)
 	 * Free IRQ before killing the tasklet to prevent the interrupt
 	 * handler from rescheduling the tasklet after it has been killed.
 	 */
-	free_irq(core_dev->irq, dev);
+	free_irq(core_dev->irq, core_dev);
 	tasklet_kill(&core_dev->tasklet);
 	/* Un-register with Linux CryptoAPI */
 	crypto4xx_unregister_alg(core_dev->dev);
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 8 lines · Rosen Penev

Instead of using a get_drvdata function to get the proper struct, just pass the proper thing directly.

Assisted-by opencode:big-pickle
---
 drivers/crypto/amcc/crypto4xx_core.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 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