lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210402111308.jx7mrfb52wbcuwjg@earth.universe>
Date:   Fri, 2 Apr 2021 13:13:08 +0200
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     Claudiu Beznea <claudiu.beznea@...rochip.com>
Cc:     nicolas.ferre@...rochip.com, alexandre.belloni@...tlin.com,
        ludovic.desroches@...rochip.com, linux-pm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kernel test robot <lkp@...el.com>,
        Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v2 1/1] power: reset: at91-reset: use devm_of_iomap

Hi,

On Fri, Apr 02, 2021 at 01:50:18PM +0300, Claudiu Beznea wrote:
> Use devm_of_iomap() to map resources. This will avoid the necessity to
> track the mapped resources and free them on failure path or on remove.
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Suggested-by: Nicolas Ferre <nicolas.ferre@...rochip.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
> ---

Thanks, queued.

-- Sebastian

> Changes in v2:
> - use devm_of_iomap()
> - change commit description and title to match to the new approach
> - add Suggested-by tag
> 
>  drivers/power/reset/at91-reset.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
> index 3ff9d93a5226..026649409135 100644
> --- a/drivers/power/reset/at91-reset.c
> +++ b/drivers/power/reset/at91-reset.c
> @@ -192,7 +192,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
>  	if (!reset)
>  		return -ENOMEM;
>  
> -	reset->rstc_base = of_iomap(pdev->dev.of_node, 0);
> +	reset->rstc_base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL);
>  	if (!reset->rstc_base) {
>  		dev_err(&pdev->dev, "Could not map reset controller address\n");
>  		return -ENODEV;
> @@ -202,7 +202,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
>  		/* we need to shutdown the ddr controller, so get ramc base */
>  		for_each_matching_node_and_match(np, at91_ramc_of_match, &match) {
>  			reset->ramc_lpr = (u32)match->data;
> -			reset->ramc_base[idx] = of_iomap(np, 0);
> +			reset->ramc_base[idx] = devm_of_iomap(&pdev->dev, np, 0, NULL);
>  			if (!reset->ramc_base[idx]) {
>  				dev_err(&pdev->dev, "Could not map ram controller address\n");
>  				of_node_put(np);
> -- 
> 2.25.1
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ