* [PATCHv2] crypto: amcc: get irq and ioremap resource first
@ 2026-08-10 19:15 Rosen Penev
2026-09-04 9:54 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-08-10 19:15 UTC (permalink / raw)
To: linux-crypto; +Cc: Herbert Xu, David S. Miller, open list
These functions can return -EPROBE_DEFER and require no special setup
other than the platform_device which is already provided.
Avoids doing extra work when not needed.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
v2; remove now dead error check.
drivers/crypto/amcc/crypto4xx_core.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index e13b49c22570..af2613c6e3c8 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1209,9 +1209,19 @@ static int crypto4xx_probe(struct platform_device *ofdev)
struct device *dev = &ofdev->dev;
struct crypto4xx_core_device *core_dev;
struct device_node *np;
+ void __iomem *ce_base;
+ int irq;
u32 pvr;
bool is_revb = true;
+ irq = platform_get_irq(ofdev, 0);
+ if (irq < 0)
+ return irq;
+
+ ce_base = devm_platform_ioremap_resource(ofdev, 0);
+ if (IS_ERR(ce_base))
+ return PTR_ERR(ce_base);
+
np = of_find_compatible_node(NULL, NULL, "amcc,ppc460ex-crypto");
if (np) {
mtdcri(SDR0, PPC460EX_SDR0_SRST,
@@ -1254,9 +1264,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
if (!core_dev->dev)
return -ENOMEM;
- core_dev->dev->ce_base = devm_platform_ioremap_resource(ofdev, 0);
- if (IS_ERR(core_dev->dev->ce_base))
- return PTR_ERR(core_dev->dev->ce_base);
+ core_dev->dev->ce_base = ce_base;
/*
* Older version of 460EX/GT have a hardware bug.
@@ -1294,11 +1302,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
(unsigned long) dev);
/* Register for Crypto isr, Crypto Engine IRQ */
- core_dev->irq = platform_get_irq(ofdev, 0);
- if (core_dev->irq < 0) {
- rc = core_dev->irq;
- goto err_tasklet;
- }
+ core_dev->irq = irq;
rc = request_irq(core_dev->irq,
is_revb ? crypto4xx_ce_interrupt_handler_revb :
crypto4xx_ce_interrupt_handler,
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCHv2] crypto: amcc: get irq and ioremap resource first
2026-08-10 19:15 [PATCHv2] crypto: amcc: get irq and ioremap resource first Rosen Penev
@ 2026-09-04 9:54 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-09-04 9:54 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-crypto, David S. Miller, open list
On Mon, Aug 10, 2026 at 12:15:59PM -0700, Rosen Penev wrote:
> These functions can return -EPROBE_DEFER and require no special setup
> other than the platform_device which is already provided.
>
> Avoids doing extra work when not needed.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> v2; remove now dead error check.
> drivers/crypto/amcc/crypto4xx_core.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-04 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 19:15 [PATCHv2] crypto: amcc: get irq and ioremap resource first Rosen Penev
2026-09-04 9:54 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.