Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3397197pxt; Tue, 10 Aug 2021 02:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfCWkzuVFRYwps1e+tXUrVKE3wwoGjmoWIQXvHk9WbR4DmcGSlbhUGPgaBalLNSOseybEW X-Received: by 2002:a17:907:1b29:: with SMTP id mp41mr27003728ejc.459.1628588318586; Tue, 10 Aug 2021 02:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628588318; cv=none; d=google.com; s=arc-20160816; b=Oglx+Pvee7STQePmXbu2k3/dSRzcQ+tpYQHMQpPw0Xv38WznmZKcazBXbjQHeDXXrN NZgLST2bpauXcwWck0B6B+1HIMaQjdFioOgB822IpMYKHEu1carJRAM0glpe8j5/h9/7 Rlfn9ygldwlGywWsEmtlJYOcwyto4/TU40mlcfBkT7xv6hgS6za951ZN2LyZDXxXknY2 JJsQu9iOh11epHqMPCbMwraDyWq8A+yvwYJGVQH8ZnMtL6drggpg+1mlGg/f4zW/mAg1 GoXofYu9LR/ZOAUtu80ifoSLVma0rfuR5s4Jrb8FvlwzPCz5QeHGVke3bTzcbBm8Ncia Kb6w== 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=JcRo3ZrIkgakX1ArAgRfew7/o7CoDvou3mWfinbrQ+WQp0HSvadIlltHiuyYtVazjw 6DdxQ0g6iTvNOQovqK96PJYgKEaHxpWN49Bz1cpynYN4//thpT+v18OvPtlCWccMug0u +Leomx2+T89veM6BC8ht6oYcRO621YMkRWAioVChryvfiGq6tysFws0iZslaon+WKhb7 N4MqyvQGCWM+rGI6HA9KRoNiLeyaftYEnWUbuEBP4KUTU/jWzWdI+GkkmBWSkLIAKIXx /5Q4jk7GpgVsNDM6tLozR6p1CTLzSAWnkdELsq9xpiznscfXwtoN5VyugUdhUyNZmKrw m24Q== 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 j12si5962153edp.527.2021.08.10.02.37.57; Tue, 10 Aug 2021 02:38:38 -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 S238075AbhHJIMM (ORCPT + 99 others); Tue, 10 Aug 2021 04:12:12 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:40314 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S238030AbhHJILJ (ORCPT ); Tue, 10 Aug 2021 04:11:09 -0400 X-UUID: 85d2c7e4a0f744b0a9bc58fc44d90ec3-20210810 X-UUID: 85d2c7e4a0f744b0a9bc58fc44d90ec3-20210810 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 462964325; Tue, 10 Aug 2021 16:10:28 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Aug 2021 16:10:26 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Aug 2021 16:10:25 +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 v3 09/13] memory: mtk-smi: Use devm_platform_ioremap_resource Date: Tue, 10 Aug 2021 16:08:55 +0800 Message-ID: <20210810080859.29511-10-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210810080859.29511-1-yong.wu@mediatek.com> References: <20210810080859.29511-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