phy: samsung: convert to devm_platform_ioremap_resource
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 6 Nov 2020 06:08:47 +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: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/1604642930-29019-14-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/samsung/phy-exynos-pcie.c
drivers/phy/samsung/phy-exynos5-usbdrd.c
drivers/phy/samsung/phy-exynos5250-sata.c
drivers/phy/samsung/phy-samsung-usb2.c

index 7e28b1a..c98fff5 100644 (file)
@@ -232,7 +232,6 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev)
        struct exynos_pcie_phy *exynos_phy;
        struct phy *generic_phy;
        struct phy_provider *phy_provider;
-       struct resource *res;
        const struct exynos_pcie_phy_data *drv_data;
 
        drv_data = of_device_get_match_data(dev);
@@ -243,13 +242,11 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev)
        if (!exynos_phy)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       exynos_phy->phy_base = devm_ioremap_resource(dev, res);
+       exynos_phy->phy_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(exynos_phy->phy_base))
                return PTR_ERR(exynos_phy->phy_base);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       exynos_phy->blk_base = devm_ioremap_resource(dev, res);
+       exynos_phy->blk_base = devm_platform_ioremap_resource(pdev, 1);
        if (IS_ERR(exynos_phy->blk_base))
                return PTR_ERR(exynos_phy->blk_base);
 
index cfa9b8b..ee0848f 100644 (file)
@@ -829,7 +829,6 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
        struct device_node *node = dev->of_node;
        struct exynos5_usbdrd_phy *phy_drd;
        struct phy_provider *phy_provider;
-       struct resource *res;
        const struct exynos5_usbdrd_phy_drvdata *drv_data;
        struct regmap *reg_pmu;
        u32 pmu_offset;
@@ -843,8 +842,7 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
        dev_set_drvdata(dev, phy_drd);
        phy_drd->dev = dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       phy_drd->reg_phy = devm_ioremap_resource(dev, res);
+       phy_drd->reg_phy = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(phy_drd->reg_phy))
                return PTR_ERR(phy_drd->reg_phy);
 
index 4dd7324..9ec2342 100644 (file)
@@ -162,7 +162,6 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
 {
        struct exynos_sata_phy *sata_phy;
        struct device *dev = &pdev->dev;
-       struct resource *res;
        struct phy_provider *phy_provider;
        struct device_node *node;
        int ret = 0;
@@ -171,9 +170,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
        if (!sata_phy)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-       sata_phy->regs = devm_ioremap_resource(dev, res);
+       sata_phy->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(sata_phy->regs))
                return PTR_ERR(sata_phy->regs);
 
index a3ed3ff..f79f605 100644 (file)
@@ -143,7 +143,6 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev)
        const struct samsung_usb2_phy_config *cfg;
        struct device *dev = &pdev->dev;
        struct phy_provider *phy_provider;
-       struct resource *mem;
        struct samsung_usb2_phy_driver *drv;
        int i, ret;
 
@@ -167,8 +166,7 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev)
        drv->cfg = cfg;
        drv->dev = dev;
 
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       drv->reg_phy = devm_ioremap_resource(dev, mem);
+       drv->reg_phy = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(drv->reg_phy)) {
                dev_err(dev, "Failed to map register memory (phy)\n");
                return PTR_ERR(drv->reg_phy);