mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
mfd: sm501: Add check for platform_driver_register()
[ Upstream commit8325a6c24a
] As platform_driver_register() can return error numbers, it should be better to check platform_driver_register() and deal with the exception. Fixes:b6d6454fdb
("[PATCH] mfd: SM501 core driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220913091112.1739138-1-jiasheng@iscas.ac.cn Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f95ba4aab6
commit
8542422192
1 changed files with 6 additions and 1 deletions
|
@ -1733,7 +1733,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue