* [PATCH 2/5] crypto: keembay - Convert to devm_platform_ioremap_resource()
2023-07-05 7:21 [PATCH 1/5] crypto: omap-des - Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-05 7:21 ` Yangtao Li
2023-07-05 7:21 ` [PATCH 3/5] crypto: atmel-aes - Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-05 7:21 UTC (permalink / raw)
To: Daniele Alessandrelli, Declan Murphy, Herbert Xu, David S. Miller
Cc: Yangtao Li, linux-crypto, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c b/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c
index d4bcbed1f546..51a6de6294cb 100644
--- a/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c
+++ b/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c
@@ -1170,7 +1170,6 @@ static int kmb_ocs_hcu_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ocs_hcu_dev *hcu_dev;
- struct resource *hcu_mem;
int rc;
hcu_dev = devm_kzalloc(dev, sizeof(*hcu_dev), GFP_KERNEL);
@@ -1184,14 +1183,7 @@ static int kmb_ocs_hcu_probe(struct platform_device *pdev)
if (rc)
return rc;
- /* Get the memory address and remap. */
- hcu_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!hcu_mem) {
- dev_err(dev, "Could not retrieve io mem resource.\n");
- return -ENODEV;
- }
-
- hcu_dev->io_base = devm_ioremap_resource(dev, hcu_mem);
+ hcu_dev->io_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hcu_dev->io_base))
return PTR_ERR(hcu_dev->io_base);
--
2.39.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 3/5] crypto: atmel-aes - Use devm_platform_get_and_ioremap_resource()
2023-07-05 7:21 [PATCH 1/5] crypto: omap-des - Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 7:21 ` [PATCH 2/5] crypto: keembay - Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-05 7:21 ` Yangtao Li
2023-07-05 7:21 ` [PATCH 4/5] crypto: atmel-sha " Yangtao Li
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-05 7:21 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Yangtao Li, linux-crypto, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/crypto/atmel-aes.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 143d33fbb316..9692254faad9 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -2566,11 +2566,9 @@ static int atmel_aes_probe(struct platform_device *pdev)
crypto_init_queue(&aes_dd->queue, ATMEL_AES_QUEUE_LENGTH);
- /* Get the base address */
- aes_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!aes_res) {
- dev_err(dev, "no MEM resource info\n");
- err = -ENODEV;
+ aes_dd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &aes_res);
+ if (IS_ERR(aes_dd->io_base)) {
+ err = PTR_ERR(aes_dd->io_base);
goto err_tasklet_kill;
}
aes_dd->phys_base = aes_res->start;
@@ -2597,13 +2595,6 @@ static int atmel_aes_probe(struct platform_device *pdev)
goto err_tasklet_kill;
}
- aes_dd->io_base = devm_ioremap_resource(&pdev->dev, aes_res);
- if (IS_ERR(aes_dd->io_base)) {
- dev_err(dev, "can't ioremap\n");
- err = PTR_ERR(aes_dd->io_base);
- goto err_tasklet_kill;
- }
-
err = clk_prepare(aes_dd->iclk);
if (err)
goto err_tasklet_kill;
--
2.39.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 4/5] crypto: atmel-sha - Use devm_platform_get_and_ioremap_resource()
2023-07-05 7:21 [PATCH 1/5] crypto: omap-des - Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 7:21 ` [PATCH 2/5] crypto: keembay - Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05 7:21 ` [PATCH 3/5] crypto: atmel-aes - Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-05 7:21 ` Yangtao Li
2023-07-05 7:21 ` [PATCH 5/5] crypto: atmel-tdes " Yangtao Li
2023-07-14 8:58 ` [PATCH 1/5] crypto: omap-des " Herbert Xu
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-05 7:21 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Yangtao Li, linux-crypto, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/crypto/atmel-sha.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 6bef634d3c86..f2031f934be9 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -2604,11 +2604,9 @@ static int atmel_sha_probe(struct platform_device *pdev)
crypto_init_queue(&sha_dd->queue, ATMEL_SHA_QUEUE_LENGTH);
- /* Get the base address */
- sha_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!sha_res) {
- dev_err(dev, "no MEM resource info\n");
- err = -ENODEV;
+ sha_dd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &sha_res);
+ if (IS_ERR(sha_dd->io_base)) {
+ err = PTR_ERR(sha_dd->io_base);
goto err_tasklet_kill;
}
sha_dd->phys_base = sha_res->start;
@@ -2635,13 +2633,6 @@ static int atmel_sha_probe(struct platform_device *pdev)
goto err_tasklet_kill;
}
- sha_dd->io_base = devm_ioremap_resource(&pdev->dev, sha_res);
- if (IS_ERR(sha_dd->io_base)) {
- dev_err(dev, "can't ioremap\n");
- err = PTR_ERR(sha_dd->io_base);
- goto err_tasklet_kill;
- }
-
err = clk_prepare(sha_dd->iclk);
if (err)
goto err_tasklet_kill;
--
2.39.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 5/5] crypto: atmel-tdes - Use devm_platform_get_and_ioremap_resource()
2023-07-05 7:21 [PATCH 1/5] crypto: omap-des - Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (2 preceding siblings ...)
2023-07-05 7:21 ` [PATCH 4/5] crypto: atmel-sha " Yangtao Li
@ 2023-07-05 7:21 ` Yangtao Li
2023-07-14 8:58 ` [PATCH 1/5] crypto: omap-des " Herbert Xu
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-05 7:21 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Yangtao Li, linux-crypto, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/crypto/atmel-tdes.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index c9ded8be9c39..ba8981f326cf 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -1172,11 +1172,9 @@ static int atmel_tdes_probe(struct platform_device *pdev)
crypto_init_queue(&tdes_dd->queue, ATMEL_TDES_QUEUE_LENGTH);
- /* Get the base address */
- tdes_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!tdes_res) {
- dev_err(dev, "no MEM resource info\n");
- err = -ENODEV;
+ tdes_dd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &tdes_res);
+ if (IS_ERR(tdes_dd->io_base)) {
+ err = PTR_ERR(tdes_dd->io_base);
goto err_tasklet_kill;
}
tdes_dd->phys_base = tdes_res->start;
@@ -1203,12 +1201,6 @@ static int atmel_tdes_probe(struct platform_device *pdev)
goto err_tasklet_kill;
}
- tdes_dd->io_base = devm_ioremap_resource(&pdev->dev, tdes_res);
- if (IS_ERR(tdes_dd->io_base)) {
- err = PTR_ERR(tdes_dd->io_base);
- goto err_tasklet_kill;
- }
-
err = atmel_tdes_hw_version_init(tdes_dd);
if (err)
goto err_tasklet_kill;
--
2.39.0
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/5] crypto: omap-des - Use devm_platform_get_and_ioremap_resource()
2023-07-05 7:21 [PATCH 1/5] crypto: omap-des - Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (3 preceding siblings ...)
2023-07-05 7:21 ` [PATCH 5/5] crypto: atmel-tdes " Yangtao Li
@ 2023-07-14 8:58 ` Herbert Xu
4 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2023-07-14 8:58 UTC (permalink / raw)
To: Yangtao Li; +Cc: David S. Miller, linux-crypto, linux-kernel
On Wed, Jul 05, 2023 at 03:21:54PM +0800, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/crypto/omap-des.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
All 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] 6+ messages in thread