[8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()

Message ID 20230706124239.23366-8-frank.li@vivo.com
State New
Headers
Series [1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 6, 2023, 12:42 p.m. UTC
  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/ata/pata_imx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Sergey Shtylyov July 6, 2023, 9:21 p.m. UTC | #1
On 7/6/23 3:42 PM, 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>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey
  
Damien Le Moal July 6, 2023, 11:40 p.m. UTC | #2
On 7/6/23 21:42, 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.

Patch title:

ata: pata_imx: ...

> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/ata/pata_imx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
> index 4013f28679a9..65d09ec94c12 100644
> --- a/drivers/ata/pata_imx.c
> +++ b/drivers/ata/pata_imx.c
> @@ -164,8 +164,7 @@ static int pata_imx_probe(struct platform_device *pdev)
>  	ap->pio_mask = ATA_PIO4;
>  	ap->flags |= ATA_FLAG_SLAVE_POSS;
>  
> -	io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
> +	priv->host_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &io_res);
>  	if (IS_ERR(priv->host_regs)) {
>  		ret = PTR_ERR(priv->host_regs);
>  		goto err;
  

Patch

diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 4013f28679a9..65d09ec94c12 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -164,8 +164,7 @@  static int pata_imx_probe(struct platform_device *pdev)
 	ap->pio_mask = ATA_PIO4;
 	ap->flags |= ATA_FLAG_SLAVE_POSS;
 
-	io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
+	priv->host_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &io_res);
 	if (IS_ERR(priv->host_regs)) {
 		ret = PTR_ERR(priv->host_regs);
 		goto err;