mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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 <yong.wu@mediatek.com> Link: https://lore.kernel.org/r/20210121062429.26504-2-yong.wu@mediatek.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
This commit is contained in:
parent
409f9fe9db
commit
1821203150
@ -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)
|
static int __init mtk_smi_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(mtk_smi_init);
|
module_init(mtk_smi_init);
|
||||||
|
Loading…
Reference in New Issue
Block a user