Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp591699pxb; Tue, 14 Sep 2021 04:41:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+mk0LR0IbtQeZHhaz9u50Brg2Ht4Y3Er36YzfA5mt1GI8RLNH2AeIU/QaVZK4tPtKGPSh X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr18244008eje.341.1631619677541; Tue, 14 Sep 2021 04:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631619677; cv=none; d=google.com; s=arc-20160816; b=fgapDyRUJAgky6UuFZ3zT8Hy5+53OwFnrDzeYZFiQIBNSJ55YIdcCWsCZi9xmpwF6U smhrhthBYFfoi+eUJrtRemkL8EuE4H/RZl7FXeRBRSOw84VdM1ovUn9yEpheH7I5cRrf YnO9Dx6/QNco/O7bToCN9D3UjSmIbDB8vkcNAVrZdnRuhsLxqexNbKnv9JM42OOC9SbK PSioSIBJxrn1ZhtCzAIS+MawYuVjMXntHg7R2RbwOzBecL5Qzl/AfufQh4cy+cWhocO6 f9MX2dTY2NZBfJYijO3amcRWwSyszqbJBrmXdINglRpCt1wXcws5abnHWGHfv1OraAXq uBtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=LZuwlAgr9LNeDd8jM97T8lk434oTGJecKpS7Txkx8M0=; b=oXB/Tmh2viupAP3SLVZPGbi6wVifIu6eZteS7CGBYth5UZBVl3zmWmIxmHfuTQHQw2 Sz45q2bbPp+D4uNSPo9/s8aTUNUKCfGMrDL/d43vXaOebFs0WOTqFjKUxsHqqzf1OEl1 BK6xZaFw4Ys/4/9HGo4aLiMiCCr2rKX1l9gj0NZT5TdadjFnm/P+Ky0Wuy7T+jaORTay iKZPKZ+Yvtk7AvB/e2jx1y/UbxIWSUdHmTi10MOV9xfsjvuu2uoDUHXtR57bZ+qmUdq7 h8fiYhgOIOU1r6QyASAEzpe92sSrUUtMwgYfxDnbhCDf/+T3BMQBadltVX8wJPkpZJbB SAXA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 2si9848478ejh.749.2021.09.14.04.40.53; Tue, 14 Sep 2021 04:41:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232376AbhINLkJ (ORCPT + 99 others); Tue, 14 Sep 2021 07:40:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:54632 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232284AbhINLkH (ORCPT ); Tue, 14 Sep 2021 07:40:07 -0400 X-UUID: d82e34ffd260499eaeb4786b963710b0-20210914 X-UUID: d82e34ffd260499eaeb4786b963710b0-20210914 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1814622162; Tue, 14 Sep 2021 19:38:46 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Sep 2021 19:38:45 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Sep 2021 19:38:43 +0800 From: Yong Wu To: Krzysztof Kozlowski , Rob Herring , Matthias Brugger CC: Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , Tomasz Figa , , , , , , , , , , , , , Ikjoon Jang Subject: [PATCH v4 09/13] memory: mtk-smi: Use devm_platform_ioremap_resource Date: Tue, 14 Sep 2021 19:36:59 +0800 Message-ID: <20210914113703.31466-10-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210914113703.31466-1-yong.wu@mediatek.com> References: <20210914113703.31466-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No functional change. Simplify probing code. Signed-off-by: Yong Wu Reviewed-by: Ikjoon Jang --- drivers/memory/mtk-smi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 58d9f7667490..a001e41f5074 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -328,7 +328,6 @@ static int mtk_smi_dts_clk_init(struct device *dev, struct mtk_smi *smi, static int mtk_smi_larb_probe(struct platform_device *pdev) { struct mtk_smi_larb *larb; - struct resource *res; struct device *dev = &pdev->dev; int ret; @@ -337,8 +336,7 @@ static int mtk_smi_larb_probe(struct platform_device *pdev) return -ENOMEM; larb->larb_gen = of_device_get_match_data(dev); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - larb->base = devm_ioremap_resource(dev, res); + larb->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(larb->base)) return PTR_ERR(larb->base); @@ -460,7 +458,6 @@ static int mtk_smi_common_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_smi *common; - struct resource *res; int ret, clk_required = MTK_SMI_COM_REQ_CLK_NR; common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); @@ -486,8 +483,7 @@ static int mtk_smi_common_probe(struct platform_device *pdev) * base. */ if (common->plat->type == MTK_SMI_GEN1) { - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - common->smi_ao_base = devm_ioremap_resource(dev, res); + common->smi_ao_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(common->smi_ao_base)) return PTR_ERR(common->smi_ao_base); @@ -499,8 +495,7 @@ static int mtk_smi_common_probe(struct platform_device *pdev) if (ret) return ret; } else { - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - common->base = devm_ioremap_resource(dev, res); + common->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(common->base)) return PTR_ERR(common->base); } -- 2.18.0