[PATCH 2/2] phy: tegra: xusb: Use devm_platform_ioremap_resource_byname
shao.mingyin at zte.com.cn
shao.mingyin at zte.com.cn
Tue Apr 1 04:40:16 PDT 2025
From: Xie Ludan <xie.ludan at zte.com.cn>
Introduce devm_platform_ioremap_resource_byname() to simplify resource
retrieval and mapping.This new function consolidates
platform_get_resource_byname() and devm_ioremap_resource() into
a single call, improving code readability and reducing API call overhead.
Signed-off-by: Xie Ludan <xie.ludan at zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin at zte.com.cn>
---
drivers/phy/tegra/xusb-tegra186.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
index fae6242aa730..6586472866e2 100644
--- a/drivers/phy/tegra/xusb-tegra186.c
+++ b/drivers/phy/tegra/xusb-tegra186.c
@@ -1485,7 +1485,6 @@ tegra186_xusb_padctl_probe(struct device *dev,
{
struct platform_device *pdev = to_platform_device(dev);
struct tegra186_xusb_padctl *priv;
- struct resource *res;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -1495,8 +1494,7 @@ tegra186_xusb_padctl_probe(struct device *dev,
priv->base.dev = dev;
priv->base.soc = soc;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ao");
- priv->ao_regs = devm_ioremap_resource(dev, res);
+ priv->ao_regs = devm_platform_ioremap_resource_byname(pdev, "ao");
if (IS_ERR(priv->ao_regs))
return ERR_CAST(priv->ao_regs);
--
2.25.1
More information about the linux-phy
mailing list