[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220526092819.1469232-1-jiasheng@iscas.ac.cn>
Date: Thu, 26 May 2022 17:28:19 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: lee.jones@...aro.org
Cc: linux-kernel@...r.kernel.org, Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] mfd: sm501: barco-p50-gpio: Add check for platform_driver_register
As platform_driver_register() could fail, it should be better
to deal with the return value in order to maintain the code
consisitency.
Fixes: b6d6454fdb66 ("[PATCH] mfd: SM501 core driver")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
drivers/mfd/sm501.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index bc0a2c38653e..41c8756bbf88 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)
+ return ret;
+
return pci_register_driver(&sm501_pci_driver);
}
--
2.25.1
Powered by blists - more mailing lists