staging: gpib: lpvo_usb: 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 error value.

Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
Link: https://lore.kernel.org/r/20241230185633.175690-13-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Nihar Chaithanya 2024-12-31 00:26:32 +05:30 committed by Greg Kroah-Hartman
parent 26098b787c
commit e3f4b64edb

View File

@ -1179,7 +1179,11 @@ static int usb_gpib_init_module(struct usb_interface *interface)
return rv;
if (!assigned_usb_minors) {
gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
rv = gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
if (rv) {
pr_err("lpvo_usb_gpib: gpib_register_driver failed: error = %d\n", rv);
goto exit;
}
} else {
/* check if minor is already registered - maybe useless, but if
* it happens the code is inconsistent somewhere