[4/8] ahci: tegra: Convert to devm_platform_ioremap_resource()

Message ID 20230706124239.23366-4-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
  Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/ata/ahci_tegra.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Damien Le Moal July 6, 2023, 11:35 p.m. UTC | #1
On 7/6/23 21:42, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.

Please be consistent with the patch titles. This should be:

ata: ahci_tegra: Convert to devm_platform_ioremap_resource()

> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/ata/ahci_tegra.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
> index 21c20793e517..d1a35da7e824 100644
> --- a/drivers/ata/ahci_tegra.c
> +++ b/drivers/ata/ahci_tegra.c
> @@ -530,8 +530,7 @@ static int tegra_ahci_probe(struct platform_device *pdev)
>  	tegra->pdev = pdev;
>  	tegra->soc = of_device_get_match_data(&pdev->dev);
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res);
> +	tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1);
>  	if (IS_ERR(tegra->sata_regs))
>  		return PTR_ERR(tegra->sata_regs);
>
  

Patch

diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
index 21c20793e517..d1a35da7e824 100644
--- a/drivers/ata/ahci_tegra.c
+++ b/drivers/ata/ahci_tegra.c
@@ -530,8 +530,7 @@  static int tegra_ahci_probe(struct platform_device *pdev)
 	tegra->pdev = pdev;
 	tegra->soc = of_device_get_match_data(&pdev->dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res);
+	tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(tegra->sata_regs))
 		return PTR_ERR(tegra->sata_regs);