[PATCH v4 08/15] staging: gpib: gpio: Return error value from gpib_register_driver()
From: Nihar Chaithanya
Date: Thu Dec 26 2024 - 14:52:03 EST
The function gpib_register_driver() can fail and does not return an
error value if it fails.
Return the error value if gpib_register_driver() fails.
Signed-off-by: Nihar Chaithanya <niharchaithanya@xxxxxxxxx>
---
drivers/staging/gpib/gpio/gpib_bitbang.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c
index a2d562cbd65b..c88d85b7dc71 100644
--- a/drivers/staging/gpib/gpio/gpib_bitbang.c
+++ b/drivers/staging/gpib/gpio/gpib_bitbang.c
@@ -1341,7 +1341,10 @@ return_to_local : bb_return_to_local,
static int __init bb_init_module(void)
{
- gpib_register_driver(&bb_interface, THIS_MODULE);
+ int result = gpib_register_driver(&bb_interface, THIS_MODULE);
+
+ if (result)
+ return result;
dbg_printk(0, "module loaded with pin map \"%s\"%s\n",
pin_map, (sn7516x_used) ? " and SN7516x driver support" : "");
--
2.34.1