From: Nihar Chaithanya Date: Mon, 30 Dec 2024 18:56:29 +0000 (+0530) Subject: staging: gpib: hp_82335: Return error value from gpib_register_driver() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4e12a0928978451f92f6c10f71ef251a082acb3f;p=users%2Fwilly%2Flinux.git 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 Link: https://lore.kernel.org/r/20241230185633.175690-10-niharchaithanya@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c index 40afe42aea47..45157ad65d53 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -325,7 +325,13 @@ void hp82335_detach(gpib_board_t *board) static int __init hp82335_init_module(void) { - gpib_register_driver(&hp82335_interface, THIS_MODULE); + int result = gpib_register_driver(&hp82335_interface, THIS_MODULE); + + if (result) { + pr_err("hp82335: gpib_register_driver failed: error = %d\n", result); + return result; + } + return 0; }