Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp270393pxb; Sat, 10 Apr 2021 02:14:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzntmGz55+cs3OLaQu9xW64IcBd5g9wGbX5r4Gwf4iB4hOVmyhqSY7WFHIaDls8Wjd8ZN9z X-Received: by 2002:a17:90a:6be2:: with SMTP id w89mr864143pjj.130.1618046098561; Sat, 10 Apr 2021 02:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618046098; cv=none; d=google.com; s=arc-20160816; b=JPLD+t5PU2Eil/P060eiAiBF9ef0n7k57lBTb6BG3jVsQ1qEy/BqQ499lNeibSOadA Csewm/1a85iXehOUZsXiRo0mi3Z+ZjkYhV890fHdbouEKLS4io6r695cXlswwhSFA5b5 sL3WTPjnmeNPJQkVoBot8ca/3mc6HnU5AzKWauc2q+1MiS/BAPPH1NLFd6DILlq6IO1j 39ZHx5mDMGAmk2PguUO/eOeVCnDZ9rKM1DHBn82aTHHHAC03qgjGM+ofSZOI/FrA+Lwc iqEZegPnGiZ85PkBO6FGw9hYT+yWqYKrYc+pkWjSUwbzgFKuNHWbLAqpIzdtyVh23JtV 302A== 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=BN79D5Ksir0oke6FdF1ujg7tb1m7Zw2Ai4QZjzHvS8U=; b=DN31QOoV9RRrNjvRKl8CLW8Nbxl7TEVqvHJekRwgaiQEBuPA+jcoudnu44p1UYBkRk NKZDDeAqPaBzeFHmQ+nyScD1wmHHUKF83cLUUPEGAvMCcyx9GgPN8HAW0hDNfRF8DUKw xKMgIpQbZFWAcolbwtK7rPheEknjLRlcV6+moWpiqzAW3x5RSd0br0RXTBLkinfQTSK1 JzCFTNUo3qfzFirrCSM/+4ykzVI9NdCaOk22h/f/C5mejEo6k6AjTHYP5JLOpjEkFLyD PP8OIcVLlhllcFGpSzpNeC4iwkvdd7ntJrD59dA3YHVcV8ONKZi12G3pMYFMZisL9vtz Aarg== 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 s2si5222025pgo.186.2021.04.10.02.14.46; Sat, 10 Apr 2021 02:14:58 -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 S234627AbhDJJOa (ORCPT + 99 others); Sat, 10 Apr 2021 05:14:30 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:38886 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234478AbhDJJOX (ORCPT ); Sat, 10 Apr 2021 05:14:23 -0400 X-UUID: c51c7e73423f4d1ca9169e358b7496a9-20210410 X-UUID: c51c7e73423f4d1ca9169e358b7496a9-20210410 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 70493827; Sat, 10 Apr 2021 17:14:05 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 17:14:03 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Apr 2021 17:14:02 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring , Krzysztof Kozlowski CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , , , Subject: [PATCH v5 14/16] memory: mtk-smi: Get rid of mtk_smi_larb_get/put Date: Sat, 10 Apr 2021 17:11:26 +0800 Message-ID: <20210410091128.31823-15-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210410091128.31823-1-yong.wu@mediatek.com> References: <20210410091128.31823-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 After adding device_link between the iommu consumer and smi-larb, the pm_runtime_get(_sync) of smi-larb and smi-common will be called automatically. we can get rid of mtk_smi_larb_get/put. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/memory/mtk-smi.c | 14 -------------- include/soc/mediatek/smi.h | 20 -------------------- 2 files changed, 34 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index c5fb51f73b34..7c61c924e220 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -134,20 +134,6 @@ static void mtk_smi_clk_disable(const struct mtk_smi *smi) clk_disable_unprepare(smi->clk_apb); } -int mtk_smi_larb_get(struct device *larbdev) -{ - int ret = pm_runtime_resume_and_get(larbdev); - - return (ret < 0) ? ret : 0; -} -EXPORT_SYMBOL_GPL(mtk_smi_larb_get); - -void mtk_smi_larb_put(struct device *larbdev) -{ - pm_runtime_put_sync(larbdev); -} -EXPORT_SYMBOL_GPL(mtk_smi_larb_put); - static int mtk_smi_larb_bind(struct device *dev, struct device *master, void *data) { diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h index 15e3397cec58..11f7d6b59642 100644 --- a/include/soc/mediatek/smi.h +++ b/include/soc/mediatek/smi.h @@ -19,26 +19,6 @@ struct mtk_smi_larb_iommu { unsigned char bank[32]; }; -/* - * mtk_smi_larb_get: Enable the power domain and clocks for this local arbiter. - * It also initialize some basic setting(like iommu). - * mtk_smi_larb_put: Disable the power domain and clocks for this local arbiter. - * Both should be called in non-atomic context. - * - * Returns 0 if successful, negative on failure. - */ -int mtk_smi_larb_get(struct device *larbdev); -void mtk_smi_larb_put(struct device *larbdev); - -#else - -static inline int mtk_smi_larb_get(struct device *larbdev) -{ - return 0; -} - -static inline void mtk_smi_larb_put(struct device *larbdev) { } - #endif #endif -- 2.18.0