OSDN Git Service

phy: marvell: convert to devm_platform_ioremap_resource
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 6 Nov 2020 06:08:40 +0000 (14:08 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 16 Nov 2020 07:17:47 +0000 (12:47 +0530)
Use devm_platform_ioremap_resource to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/1604642930-29019-7-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/marvell/phy-armada375-usb2.c
drivers/phy/marvell/phy-berlin-usb.c
drivers/phy/marvell/phy-mmp3-usb.c
drivers/phy/marvell/phy-mvebu-sata.c
drivers/phy/marvell/phy-pxa-28nm-hsic.c
drivers/phy/marvell/phy-pxa-28nm-usb2.c
drivers/phy/marvell/phy-pxa-usb.c

index fa5dc94..b141e3c 100644 (file)
@@ -105,15 +105,13 @@ static int armada375_usb_phy_probe(struct platform_device *pdev)
        struct phy *phy;
        struct phy_provider *phy_provider;
        void __iomem *usb_cluster_base;
-       struct resource *res;
        struct armada375_cluster_phy *cluster_phy;
 
        cluster_phy = devm_kzalloc(dev, sizeof(*cluster_phy), GFP_KERNEL);
        if (!cluster_phy)
                return  -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       usb_cluster_base = devm_ioremap_resource(&pdev->dev, res);
+       usb_cluster_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(usb_cluster_base))
                return PTR_ERR(usb_cluster_base);
 
index a43df63..78ef6ae 100644 (file)
@@ -165,7 +165,6 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)
        const struct of_device_id *match =
                of_match_device(phy_berlin_usb_of_match, &pdev->dev);
        struct phy_berlin_usb_priv *priv;
-       struct resource *res;
        struct phy *phy;
        struct phy_provider *phy_provider;
 
@@ -173,8 +172,7 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->base = devm_ioremap_resource(&pdev->dev, res);
+       priv->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
index 4998695..04c0bad 100644 (file)
@@ -246,7 +246,6 @@ MODULE_DEVICE_TABLE(of, mmp3_usb_phy_of_match);
 static int mmp3_usb_phy_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct resource *resource;
        struct mmp3_usb_phy *mmp3_usb_phy;
        struct phy_provider *provider;
 
@@ -254,8 +253,7 @@ static int mmp3_usb_phy_probe(struct platform_device *pdev)
        if (!mmp3_usb_phy)
                return -ENOMEM;
 
-       resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mmp3_usb_phy->base = devm_ioremap_resource(dev, resource);
+       mmp3_usb_phy->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mmp3_usb_phy->base)) {
                dev_err(dev, "failed to remap PHY regs\n");
                return PTR_ERR(mmp3_usb_phy->base);
index 3c01b5d..51a4646 100644 (file)
@@ -80,7 +80,6 @@ static const struct phy_ops phy_mvebu_sata_ops = {
 static int phy_mvebu_sata_probe(struct platform_device *pdev)
 {
        struct phy_provider *phy_provider;
-       struct resource *res;
        struct priv *priv;
        struct phy *phy;
 
@@ -88,8 +87,7 @@ static int phy_mvebu_sata_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->base = devm_ioremap_resource(&pdev->dev, res);
+       priv->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
index 31b43d2..c5c1005 100644 (file)
@@ -162,7 +162,6 @@ static int mv_hsic_phy_probe(struct platform_device *pdev)
 {
        struct phy_provider *phy_provider;
        struct mv_hsic_phy *mv_phy;
-       struct resource *r;
 
        mv_phy = devm_kzalloc(&pdev->dev, sizeof(*mv_phy), GFP_KERNEL);
        if (!mv_phy)
@@ -176,8 +175,7 @@ static int mv_hsic_phy_probe(struct platform_device *pdev)
                return PTR_ERR(mv_phy->clk);
        }
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mv_phy->base = devm_ioremap_resource(&pdev->dev, r);
+       mv_phy->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mv_phy->base))
                return PTR_ERR(mv_phy->base);
 
index a175ae9..0b390b9 100644 (file)
@@ -294,7 +294,6 @@ static int mv_usb2_phy_probe(struct platform_device *pdev)
 {
        struct phy_provider *phy_provider;
        struct mv_usb2_phy *mv_phy;
-       struct resource *r;
 
        mv_phy = devm_kzalloc(&pdev->dev, sizeof(*mv_phy), GFP_KERNEL);
        if (!mv_phy)
@@ -308,8 +307,7 @@ static int mv_usb2_phy_probe(struct platform_device *pdev)
                return PTR_ERR(mv_phy->clk);
        }
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mv_phy->base = devm_ioremap_resource(&pdev->dev, r);
+       mv_phy->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mv_phy->base))
                return PTR_ERR(mv_phy->base);
 
index 87ff755..ffe8898 100644 (file)
@@ -286,7 +286,6 @@ MODULE_DEVICE_TABLE(of, pxa_usb_phy_of_match);
 static int pxa_usb_phy_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct resource *resource;
        struct pxa_usb_phy *pxa_usb_phy;
        struct phy_provider *provider;
        const struct of_device_id *of_id;
@@ -301,8 +300,7 @@ static int pxa_usb_phy_probe(struct platform_device *pdev)
        else
                pxa_usb_phy->version = PXA_USB_PHY_MMP2;
 
-       resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       pxa_usb_phy->base = devm_ioremap_resource(dev, resource);
+       pxa_usb_phy->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(pxa_usb_phy->base)) {
                dev_err(dev, "failed to remap PHY regs\n");
                return PTR_ERR(pxa_usb_phy->base);