Skip to content

Commit 4e12a09

Browse files
niharcygregkh
authored andcommitted
staging: gpib: hp_82335: Return error value from gpib_register_driver()
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. Add pr_err() statement indicating the fail and also the error value. Signed-off-by: Nihar Chaithanya <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 908ff8d commit 4e12a09

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/staging/gpib/hp_82335/hp82335.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,13 @@ void hp82335_detach(gpib_board_t *board)
325325

326326
static int __init hp82335_init_module(void)
327327
{
328-
gpib_register_driver(&hp82335_interface, THIS_MODULE);
328+
int result = gpib_register_driver(&hp82335_interface, THIS_MODULE);
329+
330+
if (result) {
331+
pr_err("hp82335: gpib_register_driver failed: error = %d\n", result);
332+
return result;
333+
}
334+
329335
return 0;
330336
}
331337

0 commit comments

Comments
 (0)