Commit 8325a6c2 authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by Lee Jones

mfd: sm501: Add check for platform_driver_register()

As platform_driver_register() can return error numbers,
it should be better to check platform_driver_register()
and deal with the exception.

Fixes: b6d6454f ("[PATCH] mfd: SM501 core driver")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarLee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220913091112.1739138-1-jiasheng@iscas.ac.cn
parent a5e84f33
......@@ -1720,7 +1720,12 @@ static struct platform_driver sm501_plat_driver = {
static int __init sm501_base_init(void)
{
platform_driver_register(&sm501_plat_driver);
int ret;
ret = platform_driver_register(&sm501_plat_driver);
if (ret < 0)
return ret;
return pci_register_driver(&sm501_pci_driver);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment