Re: [PATCH -next] crypto: Use devm_platform_get_and_ioremap_resource()

From: Gilad Ben-Yossef
Date: Thu Feb 23 2023 - 02:33:50 EST


Hi Yang,

Thank you for the patch.

On Tue, Feb 21, 2023 at 3:34 AM Yang Li <yang.lee@xxxxxxxxxxxxxxxxx> 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: Yang Li <yang.lee@xxxxxxxxxxxxxxxxx>
> ---
> drivers/crypto/ccree/cc_driver.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c
> index d489c6f80892..c57f929805d5 100644
> --- a/drivers/crypto/ccree/cc_driver.c
> +++ b/drivers/crypto/ccree/cc_driver.c
> @@ -350,9 +350,9 @@ static int init_cc_resources(struct platform_device *plat_dev)
>
> /* Get device resources */
> /* First CC registers space */
> - req_mem_cc_regs = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
> /* Map registers space */
> - new_drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs);
> + new_drvdata->cc_base = devm_platform_get_and_ioremap_resource(plat_dev,
> + 0, &req_mem_cc_regs);
> if (IS_ERR(new_drvdata->cc_base))
> return PTR_ERR(new_drvdata->cc_base);
>
>

The patch itself is good but can you please avoid the line break after
plat_dev, it adds nothing to readability.

With this minor nitpick for the next revision -

Acked-by: Gilad Ben-Yossef <gilad@xxxxxxxxxxxxx>

Gilad




--
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!