phy: phy-mtk-hdmi: convert to devm_platform_ioremap_resource
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Tue, 17 Aug 2021 09:19:45 +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-7-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/mediatek/phy-mtk-hdmi.c

index 8ad8f717ef437e1aa5ec9eb399dffb043efaceec..5fb4217fb8e00348721a3230ee93f9645bbaddad 100644 (file)
@@ -100,7 +100,6 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct mtk_hdmi_phy *hdmi_phy;
-       struct resource *mem;
        struct clk *ref_clk;
        const char *ref_clk_name;
        struct clk_init_data clk_init = {
@@ -116,11 +115,9 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
        if (!hdmi_phy)
                return -ENOMEM;
 
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       hdmi_phy->regs = devm_ioremap_resource(dev, mem);
-       if (IS_ERR(hdmi_phy->regs)) {
+       hdmi_phy->regs = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(hdmi_phy->regs))
                return PTR_ERR(hdmi_phy->regs);
-       }
 
        ref_clk = devm_clk_get(dev, "pll_ref");
        if (IS_ERR(ref_clk)) {