From 1821203150330c4b5604b0350f23902838b53fb7 Mon Sep 17 00:00:00 2001 From: Yong Wu Date: Thu, 21 Jan 2021 14:24:27 +0800 Subject: [PATCH] memory: mtk-smi: Use platform_register_drivers In this file, we have 2 drivers, smi-common and smi-larb. Use platform_register_drivers. Signed-off-by: Yong Wu Link: https://lore.kernel.org/r/20210121062429.26504-2-yong.wu@mediatek.com Signed-off-by: Krzysztof Kozlowski --- 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 82d09b88240e..c07bb0b3144b 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);