phy-mvebu-a3700-utmi: Use devm_platform_ioremap_resource() in mvebu_a3700_utmi_phy_probe()
PATCH 1/1 phy-mvebu-a3700-utmi: Use devm_platform_ioremap_resource() in mvebu_a3700_utmi_phy_probe()
From: Markus Elfring <[email protected]>
Date: Thu, 26 Sep 2019 18:15:23 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/phy/marvell/phy-mvebu-a3700-utmi.c +1 -8
@@ -216,20 +216,13 @@ static int mvebu_a3700_utmi_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct mvebu_a3700_utmi *utmi;struct phy_provider *provider; -struct resource *res; utmi =devm_kzalloc (dev,sizeof (*utmi),GFP_KERNEL );if (!utmi)return -ENOMEM ;/* Get UTMI memory region */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"Missing UTMI PHY memory resource\n" ); -return -ENODEV ; - } - - utmi->regs =devm_ioremap_resource (dev, res); + utmi->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (utmi->regs))return PTR_ERR (utmi->regs);
--
2.23.0
Kishon Vijay Abraham I
AppliedQuoted 8 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Thu, 26 Sep 2019 18:15:23 +0200Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
merged, thanks!
-Kishon
Quoted 33 lines
--- drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/phy/marvell/phy-mvebu-a3700-utmi.c +1
-9@@ -216,20 +216,13 @@ static int mvebu_a3700_utmi_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct mvebu_a3700_utmi *utmi;struct phy_provider *provider; -struct resource *res; utmi =devm_kzalloc (dev,sizeof (*utmi),GFP_KERNEL );if (!utmi)return -ENOMEM ;/* Get UTMI memory region */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"Missing UTMI PHY memory resource\n" ); -return -ENODEV ; - } - - utmi->regs =devm_ioremap_resource (dev, res); + utmi->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (utmi->regs))return PTR_ERR (utmi->regs); --2.23.0