Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1180817pxy; Fri, 23 Apr 2021 02:06:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3768o4lCLTGGemHRJIlBcrYht5FIPFKsMTOVbxPWKQj/GQjunXXkAJ0WIyJ9IBzMxjUBw X-Received: by 2002:a17:902:ee8a:b029:eb:6d3:1431 with SMTP id a10-20020a170902ee8ab02900eb06d31431mr3063510pld.60.1619168813003; Fri, 23 Apr 2021 02:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619168812; cv=none; d=google.com; s=arc-20160816; b=hMQnUd6nWST2y/+bhJJXdfQgJ0dwQVmMNqdh1H3Iae308r9EP+b+voe/w5PsbuNbIC Clq6PGf6olsvy/Dx4XjL6VAukL1P4gAGdSMlP4D/lfqmo8ROPcb24fmE7P9dUxBQb8st K66XSURIsmlgwI2FqSWARzqHYKMmXqpof8LuhhP+1F7kegAGHJ++VK3Ov2YLeuiRFXll 8nc9rm9w19HYpeH1bv27qqzN1hj0tS8fsK0GXaRTa7DvhoyBi/rt00yzbPt/FxLw4q4+ lJo/HspolhuXPkBXWyX+isvEPiJQ3XmVO980Iw6llrLzJFBTCygB7h0yDiQkyuhdLZqu F4OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cFbSTE6Czjk4KjXKIgOiGiJfgIQnopPxCeF0GEEvNd4=; b=N7r/pa5UAxk+xR/69lba3rQXzra+HILKF4a/8VHcf2dLafTHgazmyl29iDP6Dl+iOT 18Pt8pujavYCAjXRgp7YWxFvclXgaSeyrZdgggqax8LrkTOfiyyDpSUufIDjIzZiRI96 ao6JjHaqmGlaMsCcTVAYOV+hmWdJH1gV7wELSfXGna0v4OZvFSU/2H5m1cp/AWpO/jmH qHRiSi5KEzObM5PqpoxqAUaOKfQXPP7/1IeW6onkckKQ20Jm2ge8JRpGOSwPTASUuVeK ZJOQPDJbpChIAzvGwz2lOWsBI7Jo/X8b5kwwnkW/LkANPLxa+mgCmCEUdLSUx/WhTYSg nnOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=e0UyaF+f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si6336253pfc.316.2021.04.23.02.06.40; Fri, 23 Apr 2021 02:06:52 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=e0UyaF+f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241634AbhDWJFY (ORCPT + 99 others); Fri, 23 Apr 2021 05:05:24 -0400 Received: from m12-15.163.com ([220.181.12.15]:53242 "EHLO m12-15.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhDWJFX (ORCPT ); Fri, 23 Apr 2021 05:05:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=cFbST E6Czjk4KjXKIgOiGiJfgIQnopPxCeF0GEEvNd4=; b=e0UyaF+fYUKwhBv/OJf1Y x5Oo//E4A+lzvjCCAD5T+4mxXGFhN/cB2Bghlxq/tu5CjHjTqMe7CR7pbuvaCIYo Tj46+UACCZKHj/eVCJ5AFn806b28j9FrqbOYfiC6FkziPC85KLUbt2VywrvM+st+ Mu5BsCFfdBqtAAmVdBxmyU= Received: from COOL-20201222LC.ccdomain.com (unknown [218.94.48.178]) by smtp11 (Coremail) with SMTP id D8CowAC3me2VjYJgYDbmAQ--.4S2; Fri, 23 Apr 2021 17:04:31 +0800 (CST) From: dingsenjie@163.com To: ssantosh@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dingsenjie Subject: [PATCH] soc: ti: Use devm_platform_ioremap_resource_byname Date: Fri, 23 Apr 2021 17:04:09 +0800 Message-Id: <20210423090409.25032-1-dingsenjie@163.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: D8CowAC3me2VjYJgYDbmAQ--.4S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJw4rZrWfGF4DZr13WFykXwb_yoW5Ww43pr yxKayxCrWrCrsrXayrJa1DZFsxX3W2k3yF9r4fG3WSv3s8XF9xAa1UCFWjvr1ay3yqkr13 trWFvr4UZas8XFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UXXoxUUUUU= X-Originating-IP: [218.94.48.178] X-CM-SenderInfo: 5glqw25hqmxvi6rwjhhfrp/1tbiHgB9yFSIuED+-wAAsO Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: dingsenjie Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately Signed-off-by: dingsenjie --- drivers/soc/ti/k3-ringacc.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c index b495b0d..aa8ebd4 100644 --- a/drivers/soc/ti/k3-ringacc.c +++ b/drivers/soc/ti/k3-ringacc.c @@ -1352,7 +1352,6 @@ static int k3_ringacc_init(struct platform_device *pdev, const struct soc_device_attribute *soc; void __iomem *base_fifo, *base_rt; struct device *dev = &pdev->dev; - struct resource *res; int ret, i; dev->msi_domain = of_msi_get_domain(dev, dev->of_node, @@ -1373,24 +1372,19 @@ static int k3_ringacc_init(struct platform_device *pdev, ringacc->dma_ring_reset_quirk = soc_data->dma_ring_reset_quirk; } - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rt"); - base_rt = devm_ioremap_resource(dev, res); + base_rt = devm_platform_ioremap_resource_byname(pdev, "rt"); if (IS_ERR(base_rt)) return PTR_ERR(base_rt); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fifos"); - base_fifo = devm_ioremap_resource(dev, res); + base_fifo = devm_platform_ioremap_resource_byname(pdev, "fifos"); if (IS_ERR(base_fifo)) return PTR_ERR(base_fifo); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "proxy_gcfg"); - ringacc->proxy_gcfg = devm_ioremap_resource(dev, res); + ringacc->proxy_gcfg = devm_platform_ioremap_resource_byname(pdev, "proxy_gcfg"); if (IS_ERR(ringacc->proxy_gcfg)) return PTR_ERR(ringacc->proxy_gcfg); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "proxy_target"); - ringacc->proxy_target_base = devm_ioremap_resource(dev, res); + ringacc->proxy_target_base = devm_platform_ioremap_resource_byname(pdev, "proxy_target"); if (IS_ERR(ringacc->proxy_target_base)) return PTR_ERR(ringacc->proxy_target_base); @@ -1458,7 +1452,6 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev, struct device *dev = &pdev->dev; struct k3_ringacc *ringacc; void __iomem *base_rt; - struct resource *res; int i; ringacc = devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL); @@ -1473,8 +1466,7 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev, mutex_init(&ringacc->req_lock); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ringrt"); - base_rt = devm_ioremap_resource(dev, res); + base_rt = devm_platform_ioremap_resource_byname(pdev, "ringrt"); if (IS_ERR(base_rt)) return ERR_CAST(base_rt); -- 1.9.1