phy: phy-mtk-mipi-dsi: convert to devm_platform_ioremap_resource
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Tue, 17 Aug 2021 09:19:47 +0000 (17:19 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 17 Aug 2021 10:21:59 +0000 (15:51 +0530)
Use devm_platform_ioremap_resource to simplify code

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1629191987-20774-9-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/mediatek/phy-mtk-mipi-dsi.c

index 61c942fbf4a1f299a4a1c8f138843e63bda9d839..28ad9403c44143a808503efe94f5e6056377d890 100644 (file)
@@ -130,7 +130,6 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct mtk_mipi_tx *mipi_tx;
-       struct resource *mem;
        const char *ref_clk_name;
        struct clk *ref_clk;
        struct clk_init_data clk_init = {
@@ -148,11 +147,9 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 
        mipi_tx->driver_data = of_device_get_match_data(dev);
 
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mipi_tx->regs = devm_ioremap_resource(dev, mem);
-       if (IS_ERR(mipi_tx->regs)) {
+       mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(mipi_tx->regs))
                return PTR_ERR(mipi_tx->regs);
-       }
 
        ref_clk = devm_clk_get(dev, NULL);
        if (IS_ERR(ref_clk)) {