Skip to contentSkip to conversation

mfd: sm501: Check for driver register failure

PATCH New Aditya Pakki 1 participant 1 message Dec 28, 2018 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: sm501: Check for driver register failure

While initializing the driver, the function platform_driver_register can fail and return an error. Consistent with other invocations, this patch returns the error upstream.

---
 drivers/mfd/sm501.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mfd/sm501.c +5 -1
index a530972c5a7e..62cf62636ae6 100644
@@ -1729,7 +1729,11 @@ static struct platform_driver sm501_plat_driver = {
 
 static int __init sm501_base_init(void)
 {
-	platform_driver_register(&sm501_plat_driver);
+	int rc;
+
+	rc = platform_driver_register(&sm501_plat_driver);
+	if (rc)
+		return rc;
 	return pci_register_driver(&sm501_pci_driver);
 }
 
Signature · 1 line
2.17.1