Skip to content

Commit f2ef960

Browse files
ndreysherbertx
authored andcommitted
crypto: caam - dispose of IRQ mapping only after IRQ is freed
With IRQ requesting being managed by devres we need to make sure that we dispose of IRQ mapping after and not before it is free'd (otherwise we'll end up with a warning from the kernel). To achieve that simply convert IRQ mapping to rely on devres as well. Fixes: f314f12db65c ("crypto: caam - convert caam_jr_init() to use devres") Signed-off-by: Andrey Smirnov <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Horia Geantă <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Iuliana Prodan <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 549077d commit f2ef960

File tree

1 file changed

+10
-4
lines changed
  • drivers/crypto/caam

1 file changed

+10
-4
lines changed

drivers/crypto/caam/jr.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ static int caam_jr_remove(struct platform_device *pdev)
146146
ret = caam_jr_shutdown(jrdev);
147147
if (ret)
148148
dev_err(jrdev, "Failed to shut down job ring\n");
149-
irq_dispose_mapping(jrpriv->irq);
150149

151150
return ret;
152151
}
@@ -487,6 +486,10 @@ static int caam_jr_init(struct device *dev)
487486
return error;
488487
}
489488

489+
static void caam_jr_irq_dispose_mapping(void *data)
490+
{
491+
irq_dispose_mapping((int)data);
492+
}
490493

491494
/*
492495
* Probe routine for each detected JobR subsystem.
@@ -542,12 +545,15 @@ static int caam_jr_probe(struct platform_device *pdev)
542545
return -EINVAL;
543546
}
544547

548+
error = devm_add_action_or_reset(jrdev, caam_jr_irq_dispose_mapping,
549+
(void *)jrpriv->irq);
550+
if (error)
551+
return error;
552+
545553
/* Now do the platform independent part */
546554
error = caam_jr_init(jrdev); /* now turn on hardware */
547-
if (error) {
548-
irq_dispose_mapping(jrpriv->irq);
555+
if (error)
549556
return error;
550-
}
551557

552558
jrpriv->dev = jrdev;
553559
spin_lock(&driver_data.jr_alloc_lock);

0 commit comments

Comments
 (0)