diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-09-13 17:11:12 +0800 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2022-09-28 16:17:41 +0100 |
commit | 8325a6c24ad78b8c1acc3c42b098ee24105d68e5 (patch) | |
tree | bd6c36a1f9ee72c2eb880c219b1e2eb8e5281bdc /drivers/mfd | |
parent | a5e84f33cdd7957e5497a0b324cc4bd675fb8f08 (diff) | |
download | linux-stable-8325a6c24ad78b8c1acc3c42b098ee24105d68e5.tar.gz linux-stable-8325a6c24ad78b8c1acc3c42b098ee24105d68e5.tar.bz2 linux-stable-8325a6c24ad78b8c1acc3c42b098ee24105d68e5.zip |
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: b6d6454fdb66 ("[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
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/sm501.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index bc0a2c38653e..3ac4508a6742 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -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); } |