Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4510136pxb; Tue, 31 Aug 2021 07:00:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznH/PkrpWNQjl+klXQXi9QdNuTYgEQHPmP6Z/mb3qOvtfQFLoTsFGT17fvyh1p1Mwjve91 X-Received: by 2002:a02:cacd:: with SMTP id f13mr3042186jap.94.1630418401369; Tue, 31 Aug 2021 07:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630418401; cv=none; d=google.com; s=arc-20160816; b=hxVFkjq6eJXlgEh9sGUXfO6sxgHRZyVcGjR/7VD0rD/2zSgmvR9OybX9KbTWullzRM IokYRZBdvmU9UDN/FygTqC4jyDNkiPRLPfVvJZPiddDDuTsBl9Q+17wf/kYDMv/lm5h8 pCyYouv8W9QZKJe3UvTRXPwdENUWge82bUu/vYjytAtSeRwMEnVpXwKPgdDc/fRysVAU qHXfhEeN0JsS5+0UNLuUH+tjuPDL5+h5YWMOjyfSwqH+ENATaVoreD4BnH8wJFJEZLzu yL9kd9ut6HcLbp+9DuVC96krdI0w2F+b7+2aOOrozfck3yW29+DT1griBQ1amu9H5pFZ 99gQ== 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=TT/k8Apm4dfGVnNuTclYW7Na996SVQ/LFJl0yu8B5E8=; b=fmNALgGAYMS2YVk92c1dRCzRKmRVDDbFmYAot3ZPqM59NpYOiYiPjUHZNgl7elofm0 86WZZX2n3wlR0eGfe6H52Pzwh0Kui8ULaFkOwQjYyLKk8bpxCdhLvBOeHHoHgJ7BwMWd 2TiiLAbdqyXY0ZqrOfGd1ot46dsTFrW7e2tf8SovmcXkyXZbWshpRkljx9rWyZdSOjBq 4W8gLMu8cgBhBsnUTTGVuqrAgFBPwNszVLCQy1MaMmHkBVXpDMDmT8789SI/woGDBSfg kfbYWY8miX8KqKVef+gYWhfkCMEhYdoz6gWhrCMU8p5gZQRBAXx642L3V2Mb0FArvV1e 0RMw== 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 x9si17703436jaf.48.2021.08.31.06.59.49; Tue, 31 Aug 2021 07:00:01 -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 S230466AbhHaN7d (ORCPT + 99 others); Tue, 31 Aug 2021 09:59:33 -0400 Received: from mx20.baidu.com ([111.202.115.85]:33310 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234726AbhHaN7L (ORCPT ); Tue, 31 Aug 2021 09:59:11 -0400 Received: from BC-Mail-Ex05.internal.baidu.com (unknown [172.31.51.45]) by Forcepoint Email with ESMTPS id C55C368E0499D7A89664; Tue, 31 Aug 2021 21:58:14 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex05.internal.baidu.com (172.31.51.45) 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:58:14 +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:58:14 +0800 From: Cai Huoqing To: CC: Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , , , Subject: [PATCH] drm/tegra: Make use of the helper function devm_platform_ioremap_resource() Date: Tue, 31 Aug 2021 21:58:07 +0800 Message-ID: <20210831135808.4876-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/tegra/dpaux.c | 4 +--- drivers/gpu/drm/tegra/dsi.c | 4 +--- drivers/gpu/drm/tegra/hdmi.c | 4 +--- drivers/gpu/drm/tegra/sor.c | 4 +--- drivers/gpu/drm/tegra/vic.c | 9 +-------- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 1f96e416fa08..52750853625d 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c @@ -447,7 +447,6 @@ static const struct pinmux_ops tegra_dpaux_pinmux_ops = { static int tegra_dpaux_probe(struct platform_device *pdev) { struct tegra_dpaux *dpaux; - struct resource *regs; u32 value; int err; @@ -461,8 +460,7 @@ static int tegra_dpaux_probe(struct platform_device *pdev) INIT_LIST_HEAD(&dpaux->list); dpaux->dev = &pdev->dev; - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dpaux->regs = devm_ioremap_resource(&pdev->dev, regs); + dpaux->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dpaux->regs)) return PTR_ERR(dpaux->regs); diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index f46d377f0c30..4a49fe059911 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -1550,7 +1550,6 @@ static int tegra_dsi_ganged_probe(struct tegra_dsi *dsi) static int tegra_dsi_probe(struct platform_device *pdev) { struct tegra_dsi *dsi; - struct resource *regs; int err; dsi = devm_kzalloc(&pdev->dev, sizeof(*dsi), GFP_KERNEL); @@ -1616,8 +1615,7 @@ static int tegra_dsi_probe(struct platform_device *pdev) return err; } - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dsi->regs = devm_ioremap_resource(&pdev->dev, regs); + dsi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dsi->regs)) return PTR_ERR(dsi->regs); diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index e5d2a4026028..24ab2f049710 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1637,7 +1637,6 @@ static int tegra_hdmi_probe(struct platform_device *pdev) { const char *level = KERN_ERR; struct tegra_hdmi *hdmi; - struct resource *regs; int err; hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); @@ -1712,8 +1711,7 @@ static int tegra_hdmi_probe(struct platform_device *pdev) if (err < 0) return err; - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hdmi->regs = devm_ioremap_resource(&pdev->dev, regs); + hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) return PTR_ERR(hdmi->regs); diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 0ea320c1092b..0a0917547053 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -3718,7 +3718,6 @@ static int tegra_sor_probe(struct platform_device *pdev) { struct device_node *np; struct tegra_sor *sor; - struct resource *regs; int err; sor = devm_kzalloc(&pdev->dev, sizeof(*sor), GFP_KERNEL); @@ -3791,8 +3790,7 @@ static int tegra_sor_probe(struct platform_device *pdev) } } - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - sor->regs = devm_ioremap_resource(&pdev->dev, regs); + sor->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(sor->regs)) { err = PTR_ERR(sor->regs); goto remove; diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index c02010ff2b7f..7b2eb7951b11 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -404,7 +404,6 @@ static int vic_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct host1x_syncpt **syncpts; - struct resource *regs; struct vic *vic; int err; @@ -425,13 +424,7 @@ static int vic_probe(struct platform_device *pdev) if (!syncpts) return -ENOMEM; - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!regs) { - dev_err(&pdev->dev, "failed to get registers\n"); - return -ENXIO; - } - - vic->regs = devm_ioremap_resource(dev, regs); + vic->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(vic->regs)) return PTR_ERR(vic->regs); -- 2.25.1