diff mbox series

[9/9] phy: phy-mtk-mipi-dsi: convert to devm_platform_ioremap_resource

Message ID 1627459111-2907-9-git-send-email-chunfeng.yun@mediatek.com
State Superseded
Headers show
Series [1/9] dt-bindings: phy: mediatek: tphy: support type switch by pericfg | expand

Commit Message

Chunfeng Yun (云春峰) July 28, 2021, 7:58 a.m. UTC
Use devm_platform_ioremap_resource to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Chun-Kuang Hu July 30, 2021, 4:25 p.m. UTC | #1
Hi, Chunfeng:

Chunfeng Yun <chunfeng.yun@mediatek.com> 於 2021年7月28日 週三 下午3:59寫道:
>
> 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>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 61c942fbf4a1..28ad9403c441 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -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)) {
> --
> 2.18.0
>
diff mbox series

Patch

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index 61c942fbf4a1..28ad9403c441 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -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)) {