Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp1222091lko; Tue, 13 Jul 2021 19:59:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEFW94irMeMTVgRFcxvtk+YtUfg8nqg1sjvgqg3LJ7wg3xuIpFb3GIpdWy4AMnGUXnjr4/ X-Received: by 2002:a92:8e10:: with SMTP id c16mr5120813ild.237.1626231562396; Tue, 13 Jul 2021 19:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626231562; cv=none; d=google.com; s=arc-20160816; b=B0yD0GoI53TZaXzP+o6WLjVux9o5INouhsnX3Uj0OyfYquS/5nfwLHAQro+sWPtMVv 2CphYZGe6V8Q4wLtmBJSIFzruVk5IQD2SKuySJFdMkKZvTz4Bwkn2a9JayOM2t2OrGQ1 6sQjBKzc+zUVOiVuA7P5VX9JoyO5NEyEU7+uIAPEz0fvPnC/KtgAm4NfZkNPCLT/9WeN guxmV94rHdIgw1BQvKLtZQVPIc6UkCa7whdH329YaM1vYU1B9r0UoKfPeqsUFL1fvKZ/ z8I1fqYoBVZdOJR+2S0pjsbWW3i3vE4yc1xm0Yx9kmHT/fjIco0nchUZldWIUj9B9gCs Js2w== 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=EgrkzhPdybqqc9B4aYoVvdWyyXAXVHLS/u4EEWCfiVM=; b=UBBr+M3On2GtAv/IMPGu4ZnKISXGw1v9yxz8ODWlPD8pla4dWOMHFFCvFNy9qwRIKI gtx8VsDrZoQ+pfMxOH7yRAZ7g5zjCUvluG2HubvIb37/EclI/HaqrRDhU9TxW5Dz5q92 USPah9AJnsqtRqLEkzleNbj7mGzXdgJy+p8nHqxwVLHO+vbgyAhiSr9KZJJEcLB5jwxA r094gG1bh9I67Ru9XoaxsMxLIRZYpd+bP6OKJ76RZRlBJzgt0+SJ/G0zsp35StPfagNW m8f30ocdqBCtS7D3c4D6xjeeWiLlhB8gy2CECLRa5UkwagYMssea5D62dgGTysmAske9 4jUA== 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 h15si906154ili.7.2021.07.13.19.59.09; Tue, 13 Jul 2021 19:59:22 -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 S237801AbhGNDBM (ORCPT + 99 others); Tue, 13 Jul 2021 23:01:12 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:42040 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237436AbhGNDBM (ORCPT ); Tue, 13 Jul 2021 23:01:12 -0400 X-UUID: 25a75590ae6d42268889270e2aee6d7a-20210714 X-UUID: 25a75590ae6d42268889270e2aee6d7a-20210714 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 1335530300; Wed, 14 Jul 2021 10:58:18 +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; Wed, 14 Jul 2021 10:58:16 +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; Wed, 14 Jul 2021 10:58:15 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , David Airlie , Mauro Carvalho Chehab CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , , , , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Xia Jiang , Tiffany Lin , Dafna Hirschfeld , Hsin-Yi Wang , Eizan Miyamoto , Subject: [PATCH v6 09/11] memory: mtk-smi: Get rid of mtk_smi_larb_get/put Date: Wed, 14 Jul 2021 10:56:24 +0800 Message-ID: <20210714025626.5528-10-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210714025626.5528-1-yong.wu@mediatek.com> References: <20210714025626.5528-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 Acked-by: Krzysztof Kozlowski Acked-by: Matthias Brugger --- 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