2023-07-07 10:17:37

by 李扬韬

[permalink] [raw]
Subject: [PATCH v2 04/11] ata: ahci_tegra: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
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);

--
2.39.0



2023-07-07 13:13:19

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v2 04/11] ata: ahci_tegra: Convert to devm_platform_ioremap_resource()

On Fri, Jul 07, 2023 at 05:55:06PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> drivers/ata/ahci_tegra.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (316.00 B)
signature.asc (849.00 B)
Download all attachments