From: Yong Wu <yong.wu@mediatek.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Joerg Roedel <joro@8bytes.org>,
Robin Murphy <robin.murphy@arm.com>,
Will Deacon <will@kernel.org>, Tomasz Figa <tfiga@google.com>,
<linux-mediatek@lists.infradead.org>,
<srv_heupstream@mediatek.com>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<iommu@lists.linux-foundation.org>, <yong.wu@mediatek.com>,
<youlin.pei@mediatek.com>,
Nicolas Boichat <drinkcat@chromium.org>, <anan.sun@mediatek.com>,
<yi.kuo@mediatek.com>
Subject: [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
Date: Thu, 21 Jan 2021 14:24:27 +0800 [thread overview]
Message-ID: <20210121062429.26504-2-yong.wu@mediatek.com> (raw)
In-Reply-To: <20210121062429.26504-1-yong.wu@mediatek.com>
In this file, we have 2 drivers, smi-common and smi-larb.
Use platform_register_drivers.
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
drivers/memory/mtk-smi.c | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index ac350f8d1e20..e2aebd2bfa8e 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -587,26 +587,13 @@ static struct platform_driver mtk_smi_common_driver = {
}
};
+static struct platform_driver * const smidrivers[] = {
+ &mtk_smi_common_driver,
+ &mtk_smi_larb_driver,
+};
+
static int __init mtk_smi_init(void)
{
- int ret;
-
- ret = platform_driver_register(&mtk_smi_common_driver);
- if (ret != 0) {
- pr_err("Failed to register SMI driver\n");
- return ret;
- }
-
- ret = platform_driver_register(&mtk_smi_larb_driver);
- if (ret != 0) {
- pr_err("Failed to register SMI-LARB driver\n");
- goto err_unreg_smi;
- }
- return ret;
-
-err_unreg_smi:
- platform_driver_unregister(&mtk_smi_common_driver);
- return ret;
+ return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
}
-
module_init(mtk_smi_init);
--
2.18.0
next prev parent reply other threads:[~2021-01-21 6:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 6:24 Support MTK_SMI modular Yong Wu
2021-01-21 6:24 ` Yong Wu [this message]
2021-01-22 21:31 ` [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers Krzysztof Kozlowski
2021-01-21 6:24 ` [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license Yong Wu
2021-01-22 21:34 ` Krzysztof Kozlowski
2021-01-25 6:49 ` Yong Wu
2021-01-25 8:40 ` Krzysztof Kozlowski
2021-01-25 9:28 ` Yong Wu
2021-01-25 10:40 ` Krzysztof Kozlowski
2021-01-26 6:12 ` Yong Wu
2021-01-21 6:24 ` [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate Yong Wu
2021-01-22 21:35 ` Krzysztof Kozlowski
2021-01-25 6:49 ` Yong Wu
2021-01-25 8:44 ` Krzysztof Kozlowski
2021-01-25 10:11 ` Yong Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210121062429.26504-2-yong.wu@mediatek.com \
--to=yong.wu@mediatek.com \
--cc=anan.sun@mediatek.com \
--cc=drinkcat@chromium.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robin.murphy@arm.com \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@google.com \
--cc=will@kernel.org \
--cc=yi.kuo@mediatek.com \
--cc=youlin.pei@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).