Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1733932ybe; Tue, 3 Sep 2019 02:41:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPHBmypho8CWNj0dR8Y1XwBsopj2+BYMTKY94cZL0zZbdM+lBF/ao1wd//bK9Y86gHLSIF X-Received: by 2002:a63:1d2:: with SMTP id 201mr30305095pgb.307.1567503659835; Tue, 03 Sep 2019 02:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567503659; cv=none; d=google.com; s=arc-20160816; b=JkPV072EFaZHKvVy9fTaZeUldN4hAsmSZ0SWpf2ImJoJIkyRTwrlLtmfF3ITnwKjtH SRpjDsV2Hh7rPLJamI6gcF5Pe6NS3y/5mrNVjRuBhvfk8RZXtYHhEDT179ivO4QMt0kj zz7RlcQVwNfBGqrWIrE4W77CWVme61vi/MpUsgdtQqa2D8xXUYpkuT/Cofx/AbOFBGCI VTh2VksJh+nKkpIOFGoXGQ5Bjdo0VR4rDYMtzJS9Isxt6KqicJsuqOzXsQzH8lRh7aOu TDeotW8lVztmZyjRK3UfRfgNAGUQ79ETYm7Q97F9hQjH4iAQdFiXoHEOKgszgZ/Xm0R9 Gulw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=4QVeYBVJ+Hqney3lYBt/dErSTDdAZbBEnQ3Q+YTWUfw=; b=U5c3ijw0pheFTrEKJQKyXmTy6emprMKFfSouXURXuLdOpl4J3C9r8jbW1Wy7+6TOGE e0ILyuisPWgJtHTSpvf8UvZuoSuPUtnkYWBho7Dvuy5DGh2kUJtErQcD0T0aql2uJU0o hBX7H1BcZhMuNzgj6uNlpmKaTzetlaYFll65ocQKss8ZPunWm8N3MMnialbnHbHibCsg ecsiDDjLpW5xHLTTnKMXjzSISKAO8hbZS42uR8rGdm3Mdx3FDrqIv782yF7bC2UQRZAa zVnlSriiTEEC3CR0RynnCOg5I03Q13KXfQy882TvOPWTf4dsj8TfO8YRvBFqGCui8V+o pVRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id i19si849121pfd.284.2019.09.03.02.40.44; Tue, 03 Sep 2019 02:40:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728882AbfICJji (ORCPT + 99 others); Tue, 3 Sep 2019 05:39:38 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:22989 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728426AbfICJji (ORCPT ); Tue, 3 Sep 2019 05:39:38 -0400 X-UUID: 062de98fc271449eb3b9f3d0d0b84651-20190903 X-UUID: 062de98fc271449eb3b9f3d0d0b84651-20190903 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1348906545; Tue, 03 Sep 2019 17:39:32 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 3 Sep 2019 17:39:31 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 3 Sep 2019 17:39:30 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , Subject: [PATCH v3 09/14] memory: mtk-smi: Get rid of mtk_smi_larb_get/put Date: Tue, 3 Sep 2019 17:37:31 +0800 Message-ID: <1567503456-24725-10-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1567503456-24725-1-git-send-email-yong.wu@mediatek.com> References: <1567503456-24725-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org 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 5dab56c..3df9036 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -125,20 +125,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_get_sync(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 5a34b87..f8bf595 100644 --- a/include/soc/mediatek/smi.h +++ b/include/soc/mediatek/smi.h @@ -20,26 +20,6 @@ struct mtk_smi_larb_iommu { unsigned int mmu; }; -/* - * 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 -- 1.9.1