crypto: amcc: get irq and ioremap resource first
PATCH 1/1 crypto: amcc: get irq and ioremap resource first
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 <[email protected]>
--- drivers/crypto/amcc/crypto4xx_core.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/crypto/amcc/crypto4xx_core.c +12 -4
@@ -1206,9 +1206,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,
@@ -1251,9 +1261,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.
@@ -1291,7 +1299,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 ); + core_dev->irq = irq;if (core_dev->irq <0 ) { rc = core_dev->irq; goto err_iomap;
Signature · 1 line
2.55.0
Herbert Xu
maintainerQuoted 9 lines · Rosen Penev
These functions can return -EPROBE_DEFER and require no special setup other than the
platform_devicewhich is already provided.Avoids doing extra work when not needed.
Signed-off-by Rosen Penev <[email protected]>--- drivers/crypto/amcc/crypto4xx_core.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
Please check the Sashiko comments on this patch:
https://sashiko.dev/#/patchset/20260730204915.1102403-1-rosenp%40gmail.com
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