Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4385897pxb; Tue, 26 Jan 2021 21:52:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPxhCKCDIVAdwUuIKnEZLJZ65Z8Om4tWKoaSc0b+qOydOJG/zY4q814x6ASh99TEZPOwh8 X-Received: by 2002:a05:6402:70f:: with SMTP id w15mr7519134edx.121.1611726764808; Tue, 26 Jan 2021 21:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611726764; cv=none; d=google.com; s=arc-20160816; b=U/cEa0mLri7VvKa5WUzynnNHqyTb11RIavU17L+RqH2Yh26eDJ5rQfXvh5QsbrEaaI Eo+JacBkHEFi9oT1GZzBRUq5Mm7zFwPusxIcoCST46MPdsXIG7aR26YMmw4BYnyeQIgP +Tqj8+RJfv9t2sSLQ62x/kC/3eG+AvdjJwNsHX6TXnlqDW/CUQYzD+2mbUk7Cr1QJHsD 45FeAoL3MmtIYjmCzB8QsLwS9C+jBLBxo1kMo85r3LQjMrW95XEf4aDXfIs4Ir8bqNwl Ltbj7hvDFE3Efpf/NOJfAc+q5P2U1edKbpLNxXbDoDaSQAAuFygOtfFyz7i9p1xwIEPI MGiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=KGlEFhhkY4ld5djcep04zCqjiNUTS3p944IswBKUesI=; b=AKjwL8Ito51VrViOz4AYzhtFNuy2cqIh7ULsBx7HZzDLfy9eNMiyQ7zl9SqYv06DIx KD3sSw2Wd3+Ltlo1Ei/wTyp77XDlzRLER1yCa2vKxxJqD4+4AdtPbhXufD6S6NlXVZDp Sj1VHOZOEi7yPvvXgpmrGo828FerIiOVN6Phx+gXK8YRLxdm5GxetMYt5bb9eMoShzIz 0Ux/s6fk1QeOrcdkx+L7u9YrrmtVnNLTGv6xtJwxAk+XzVSy4gOcaqbumPEyXxhwxImL DPfIz2ULbiRKELzR/q+28L+1FVHdQ6xcKmXeEyO47uL41B/MVhtuhBhjr+ojASmHEdGR IFEw== 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 t3si434001edw.266.2021.01.26.21.52.01; Tue, 26 Jan 2021 21:52:44 -0800 (PST) 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 S1728550AbhAZRI2 (ORCPT + 99 others); Tue, 26 Jan 2021 12:08:28 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:54130 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727309AbhAZGCD (ORCPT ); Tue, 26 Jan 2021 01:02:03 -0500 X-UUID: beee6b93ef014787948b329bda876e1d-20210126 X-UUID: beee6b93ef014787948b329bda876e1d-20210126 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] 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 595013166; Tue, 26 Jan 2021 14:01:06 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 26 Jan 2021 14:01:04 +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; Tue, 26 Jan 2021 14:01:03 +0800 From: Yong Wu To: Krzysztof Kozlowski , Matthias Brugger CC: Joerg Roedel , Robin Murphy , Will Deacon , Tomasz Figa , , , , , , , , Nicolas Boichat , , Subject: [PATCH v2] memory: mtk-smi: Support SMI modular Date: Tue, 26 Jan 2021 14:00:55 +0800 Message-ID: <20210126060055.11050-1-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 413277F7CA28486647A4C0608B164AEC3EA3B448FD5BFC262DF895F4FE03C3FF2000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch mainly support SMI modular. Switch MTK_SMI to tristate, and add module_exit/module_license. Signed-off-by: Yong Wu --- This patch rebase on the clean v5.11-rc1. and this one: memory: mtk-smi: Use platform_register_drivers https://lore.kernel.org/linux-arm-kernel/20210121062429.26504-2-yong.wu@mediatek.com/ change note: a) squash the last two of v1 into one patch. b) Remove module_alias --- drivers/memory/Kconfig | 2 +- drivers/memory/mtk-smi.c | 9 +++++++++ include/soc/mediatek/smi.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig index 3ea6913df176..05c6d4a32285 100644 --- a/drivers/memory/Kconfig +++ b/drivers/memory/Kconfig @@ -173,7 +173,7 @@ config JZ4780_NEMC memory devices such as NAND and SRAM. config MTK_SMI - bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST + tristate "MediaTek SoC Memory Controller driver" if COMPILE_TEST depends on ARCH_MEDIATEK || COMPILE_TEST help This driver is for the Memory Controller module in MediaTek SoCs, diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index e2aebd2bfa8e..3a269415db73 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -597,3 +597,12 @@ static int __init mtk_smi_init(void) return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers)); } module_init(mtk_smi_init); + +static void __exit mtk_smi_exit(void) +{ + platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers)); +} +module_exit(mtk_smi_exit); + +MODULE_DESCRIPTION("MediaTek SMI driver"); +MODULE_LICENSE("GPL v2"); diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h index 5a34b87d89e3..29e2fb8f33d6 100644 --- a/include/soc/mediatek/smi.h +++ b/include/soc/mediatek/smi.h @@ -9,7 +9,7 @@ #include #include -#ifdef CONFIG_MTK_SMI +#if IS_ENABLED(CONFIG_MTK_SMI) #define MTK_LARB_NR_MAX 16 -- 2.18.0