phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname()
Subsystems (2)
PATCH 1/1 phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname()
From: Ye Xingchen <[email protected]>
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does.
--- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/phy/marvell/phy-mvebu-a3700-comphy.c +4 -12
@@ -1241,7 +1241,6 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)struct mvebu_a3700_comphy_priv *priv;struct phy_provider *provider;struct device_node *child; -struct resource *res;struct clk *clk;int ret;
@@ -1251,26 +1250,19 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)spin_lock_init (&priv->lock); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"comphy" ); - priv->comphy_regs =devm_ioremap_resource (&pdev->dev, res); + priv->comphy_regs =devm_platform_ioremap_resource_byname (pdev,"comphy" );if (IS_ERR (priv->comphy_regs))return PTR_ERR (priv->comphy_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"lane1_pcie_gbe" ); - priv->lane1_phy_regs =devm_ioremap_resource (&pdev->dev, res); + priv->lane1_phy_regs =devm_platform_ioremap_resource_byname (pdev,"lane1_pcie_gbe" );if (IS_ERR (priv->lane1_phy_regs))return PTR_ERR (priv->lane1_phy_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"lane0_usb3_gbe" ); - priv->lane0_phy_regs =devm_ioremap_resource (&pdev->dev, res); + priv->lane0_phy_regs =devm_platform_ioremap_resource_byname (pdev,"lane0_usb3_gbe" );if (IS_ERR (priv->lane0_phy_regs))return PTR_ERR (priv->lane0_phy_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"lane2_sata_usb3" ); - priv->lane2_phy_indirect =devm_ioremap_resource (&pdev->dev, res); + priv->lane2_phy_indirect =devm_platform_ioremap_resource_byname (pdev,"lane2_sata_usb3" );if (IS_ERR (priv->lane2_phy_indirect))return PTR_ERR (priv->lane2_phy_indirect);
Signature · 1 line
2.25.1
Hello,
[email protected] wrote on Wed, 22 Mar 2023 10:07:04 +0800 (CST):
Quoted 7 lines
From: Ye Xingchen <[email protected]>
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single call to
devm_platform_ioremap_resource_byname(), as this is exactly what this function does.Signed-off-by Ye Xingchen <[email protected]>
Thanks,
Miquèl
Quoted 44 lines · On Wed, 22 Mar 2023 10:07:04 +0800 (CST) <[email protected]> wrote:
From: Ye Xingchen <[email protected]>
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single call to
devm_platform_ioremap_resource_byname(), as this is exactly what this function does.Signed-off-by Ye Xingchen <[email protected]>--- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)drivers/phy/marvell/phy-mvebu-a3700-comphy.c +3
-9@@ -1241,7 +1241,6 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)struct mvebu_a3700_comphy_priv *priv;struct phy_provider *provider;struct device_node *child; -struct resource *res;struct clk *clk;int ret;@@ -1251,26 +1250,19 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)spin_lock_init (&priv->lock); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"comphy" ); - priv->comphy_regs =devm_ioremap_resource (&pdev->dev, res); + priv->comphy_regs =devm_platform_ioremap_resource_byname (pdev,"comphy" );if (IS_ERR (priv->comphy_regs))return PTR_ERR (priv->comphy_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"lane1_pcie_gbe" ); - priv->lane1_phy_regs =devm_ioremap_resource (&pdev->dev, res); + priv->lane1_phy_regs =devm_platform_ioremap_resource_byname (pdev,"lane1_pcie_gbe" );if (IS_ERR (priv->lane1_phy_regs))return PTR_ERR (priv->lane1_phy_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"lane0_usb3_gbe" ); - priv->lane0_phy_regs =devm_ioremap_resource (&pdev->dev, res); + priv->lane0_phy_regs =devm_platform_ioremap_resource_byname (pdev,"lane0_usb3_gbe" );
drivers/phy/marvell/phy-mvebu-a3700-comphy.c static int mvebu_a3700_comphy_probe(struct platform_device *pdev) · line 1268
Quoted 10 lines
drivers/phy/marvell/phy-mvebu-a3700-comphy.c +1
-3if (IS_ERR (priv->lane0_phy_regs))return PTR_ERR (priv->lane0_phy_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"lane2_sata_usb3" ); - priv->lane2_phy_indirect =devm_ioremap_resource (&pdev->dev, res); + priv->lane2_phy_indirect =devm_platform_ioremap_resource_byname (pdev,"lane2_sata_usb3" );if (IS_ERR (priv->lane2_phy_indirect))return PTR_ERR (priv->lane2_phy_indirect);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy