Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp410478pxv; Thu, 15 Jul 2021 07:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxChXRL9XpBpFaScWeWypwqwDPfdyOUKGOuBsDRzCTTC7anrgcFZn5XlkdLAD1GnWv0bxjG X-Received: by 2002:a92:cf05:: with SMTP id c5mr2718815ilo.196.1626358095860; Thu, 15 Jul 2021 07:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626358095; cv=none; d=google.com; s=arc-20160816; b=UpCWvYVTBj45jPbYUXoOxJhP+PIZNkbDzY6Jk3GokgF8iPpleyXnA9vn8V1E9ERIuQ Fl9D402fZuB2UTSCtok4YiHGBfRyqiaRWrWN8R36oJ/VAiBSSkuGAchDpi7vvTIwDxkJ IWZqrgjAnp+HhTQDDLpKVKLyuz6v/4kHI9aVXY45nr12tZed9ej5PHbStir3TzLUjgup 5EC/s6wwex81PeD0kLKaRjvhwODAwrmRLjMbD/B/AIsqzuAeDFzPuTAYWlLpvDf6OaIk VQ2Deo0EbJfO7/ydWWzk2Q84pnDqgym2hTWYpF39fHBE6HKSS5E6ZYjtR5s4Dr9R6bqr O/DQ== 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=bCOUKG6wYqUpn+FgJ0Tr0I00/dyGffIVLV7l6dQ1/44=; b=LVdpEJAHdePnIcDscoww4SIAKzsfIjpgrBHFVXDkqsRM1v+Nb/nVpQ4CS+zj5alCB1 7YwnA3AvLOdB3bXIdbaLhfTvNXtbpNgw2HhsjmriL8/3SFxmcIhk62SoC0p/HPDWA0hC 6P8/OqXAqnH0Jg3Any8WaZXF8sj8V11VMqMRobMrxvXyKXctJw/IiopFhm9erlf7lP4X ul2h7oE/TwN6eOIPT7dmRCq/m+W5mCfB19Oz38xN3TwYbhvaN0PjSoAGQTwQ27DhvWid YXrIzlX/aulz19mRCz9t5H10D2s6Z1esORvoBxWNYQP89K0apLu9KQkPu6er1Tinkvwp fNCA== 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 y14si6605009iot.9.2021.07.15.07.07.59; Thu, 15 Jul 2021 07:08:15 -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 S234815AbhGOMQ1 (ORCPT + 99 others); Thu, 15 Jul 2021 08:16:27 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:40452 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235394AbhGOMQ0 (ORCPT ); Thu, 15 Jul 2021 08:16:26 -0400 X-UUID: 9cf31c09bac84611a4716b3ab8afb329-20210715 X-UUID: 9cf31c09bac84611a4716b3ab8afb329-20210715 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 346738490; Thu, 15 Jul 2021 20:13:30 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul 2021 20:13:29 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 15 Jul 2021 20:13:28 +0800 From: Yong Wu To: Krzysztof Kozlowski , Rob Herring , Matthias Brugger CC: Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , Tomasz Figa , , , , , , , , , , , , Subject: [PATCH v2 08/11] memory: mtk-smi: Use devm_platform_ioremap_resource Date: Thu, 15 Jul 2021 20:12:06 +0800 Message-ID: <20210715121209.31024-9-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210715121209.31024-1-yong.wu@mediatek.com> References: <20210715121209.31024-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 --- 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 ee49bb50f5f5..e5a34b3952a0 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -317,7 +317,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; @@ -326,8 +325,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); @@ -447,7 +445,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; common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); @@ -468,8 +465,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); @@ -481,8 +477,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