Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4508614pxb; Tue, 31 Aug 2021 06:57:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB+5dJDdcmrTjhpVoOjKiWmxgIESwCvcdxSz8dReGA2z2RwMGdMwCo8qut9gtNxhKk5aNZ X-Received: by 2002:a02:b092:: with SMTP id v18mr3020676jah.51.1630418277369; Tue, 31 Aug 2021 06:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630418277; cv=none; d=google.com; s=arc-20160816; b=oOknf1OVqpCZzeR1yDIIG++bKuC7eeqJl3q0jCyoLep2ND+gtG958qRbYtoryad0W1 Jy8tpzQ+o7V2PQmZRuNaWM2vAPd3Xe7TTEzNhJ6FVaRFax0fjno4DQZI2IbyaPqPlbSY X/piRH6u9fmztxkBOZm7XXwWYWcaS0PemTybnE0QQx99qqECR+3ImI/1wf5T9R9uoF9/ 0lYwTlW9oaBvZlgb69ullFHhoJKPrPsdE9yPE1tzd+py14Ud+fcoUu49PPELXorPb/Qb z6XZrdGf/jd5xvfe+/eYR1iRORqd5qd/J5p84EMKCfy+qah/UHqBfbZroAIG3+m0F4I7 q5Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=L0MTBwm0+WY0ZfCMO2HonWLgi+J4y9NvzQpN3vKh2uY=; b=aLJ3d4NovA+N/h8fz6BdzwtShsVT+Q5IIgCFDZ+TFbcCTRQsMSSFvCDQXZ0fp/wXIR XqDS3UXLOmsf4pqngDX1guZYHQ7vo07/4+igYKY6+zvzi7elZfwWXMEkEvYVSBM0TCTr NZvRWFMoNNvsTOVqXem0gHxXQkvS9hVfGs8LyZIZQesvTPd4iVQqsxdXbaCbXyZMx9e+ fbrYRt5el2Pj3XUpqPSKQnwo2LmCvUbYADhIAI6NiwDZp/lkFYDHgOjJvqxDB9LWCWUP TjpvXwgBOQtnTx/oRusJp5PWGTQXSxLXp1ugWRUizb1kAcRKVqye51bsCR86GY7brxQB TbSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c19si16970218ilj.48.2021.08.31.06.57.44; Tue, 31 Aug 2021 06:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbhHaN52 (ORCPT + 99 others); Tue, 31 Aug 2021 09:57:28 -0400 Received: from mx20.baidu.com ([111.202.115.85]:59972 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230291AbhHaN5W (ORCPT ); Tue, 31 Aug 2021 09:57:22 -0400 Received: from Bc-Mail-Ex13.internal.baidu.com (unknown [172.31.51.53]) by Forcepoint Email with ESMTPS id C04BDD117DA7C720DE6E; Tue, 31 Aug 2021 21:56:23 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by Bc-Mail-Ex13.internal.baidu.com (172.31.51.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Tue, 31 Aug 2021 21:56:23 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 31 Aug 2021 21:56:22 +0800 From: Cai Huoqing To: CC: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , , , , Subject: [PATCH] drm/mediatek: Make use of the helper function devm_platform_ioremap_resource() Date: Tue, 31 Aug 2021 21:56:16 +0800 Message-ID: <20210831135617.4526-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex30.internal.baidu.com (172.31.51.24) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing --- drivers/gpu/drm/mediatek/mtk_cec.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_aal.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_ccorr.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_color.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 4 +--- drivers/gpu/drm/mediatek/mtk_dpi.c | 4 +--- drivers/gpu/drm/mediatek/mtk_dsi.c | 4 +--- drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 +--- 10 files changed, 10 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c index e9cef5c0c8f7..7b5f28f63c65 100644 --- a/drivers/gpu/drm/mediatek/mtk_cec.c +++ b/drivers/gpu/drm/mediatek/mtk_cec.c @@ -183,7 +183,6 @@ static int mtk_cec_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_cec *cec; - struct resource *res; int ret; cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL); @@ -193,8 +192,7 @@ static int mtk_cec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, cec); spin_lock_init(&cec->lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - cec->regs = devm_ioremap_resource(dev, res); + cec->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(cec->regs)) { ret = PTR_ERR(cec->regs); dev_err(dev, "Failed to ioremap cec: %d\n", ret); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c b/drivers/gpu/drm/mediatek/mtk_disp_aal.c index dadd1afed076..3a5bc05a57c1 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c @@ -102,7 +102,6 @@ static int mtk_disp_aal_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_aal *priv; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -115,8 +114,7 @@ static int mtk_disp_aal_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) { dev_err(dev, "failed to ioremap aal\n"); return PTR_ERR(priv->regs); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c index 141cb36b9c07..3520f735e9e3 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c @@ -158,7 +158,6 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_ccorr *priv; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -171,8 +170,7 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) { dev_err(dev, "failed to ioremap ccorr\n"); return PTR_ERR(priv->regs); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c index 473f5bb5cbad..3050f6851511 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_color.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c @@ -96,7 +96,6 @@ static int mtk_disp_color_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_color *priv; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -109,8 +108,7 @@ static int mtk_disp_color_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) { dev_err(dev, "failed to ioremap color\n"); return PTR_ERR(priv->regs); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index 3a5815ab4079..b891e33d5adc 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c @@ -129,7 +129,6 @@ static int mtk_disp_gamma_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_gamma *priv; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -142,8 +141,7 @@ static int mtk_disp_gamma_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) { dev_err(dev, "failed to ioremap gamma\n"); return PTR_ERR(priv->regs); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 5326989d5206..da6c09122836 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -374,7 +374,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_ovl *priv; - struct resource *res; int irq; int ret; @@ -392,8 +391,7 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) { dev_err(dev, "failed to ioremap ovl\n"); return PTR_ERR(priv->regs); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c index 75d7f45579e2..e1a79db0ee87 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c @@ -272,7 +272,6 @@ static int mtk_disp_rdma_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_rdma *priv; - struct resource *res; int irq; int ret; @@ -290,8 +289,7 @@ static int mtk_disp_rdma_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) { dev_err(dev, "failed to ioremap rdma\n"); return PTR_ERR(priv->regs); diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 4554e2de1430..1a226b16ae67 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -827,7 +827,6 @@ static int mtk_dpi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_dpi *dpi; - struct resource *mem; int ret; dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); @@ -858,8 +857,7 @@ static int mtk_dpi_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Cannot find pinctrl active!\n"); } } - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dpi->regs = devm_ioremap_resource(dev, mem); + dpi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dpi->regs)) { ret = PTR_ERR(dpi->regs); dev_err(dev, "Failed to ioremap mem resource: %d\n", ret); diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 93b40c245f00..a5ced78e81fd 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1002,7 +1002,6 @@ static int mtk_dsi_probe(struct platform_device *pdev) struct mtk_dsi *dsi; struct device *dev = &pdev->dev; struct drm_panel *panel; - struct resource *regs; int irq_num; int ret; @@ -1058,8 +1057,7 @@ static int mtk_dsi_probe(struct platform_device *pdev) goto err_unregister_host; } - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dsi->regs = devm_ioremap_resource(dev, regs); + dsi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dsi->regs)) { ret = PTR_ERR(dsi->regs); dev_err(dev, "Failed to ioremap memory: %d\n", ret); diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 5838c44cbf6f..6ff0ae4f3634 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1426,7 +1426,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct device_node *cec_np, *remote, *i2c_np; struct platform_device *cec_pdev; struct regmap *regmap; - struct resource *mem; int ret; ret = mtk_hdmi_get_all_clk(hdmi, np); @@ -1472,8 +1471,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, } hdmi->sys_regmap = regmap; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hdmi->regs = devm_ioremap_resource(dev, mem); + hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) { ret = PTR_ERR(hdmi->regs); goto put_device; -- 2.25.1