]> Gentwo Git Trees - linux/.git/commit
staging: gpib: ines: Handle gpib_register_driver() errors
authorNihar Chaithanya <niharchaithanya@gmail.com>
Mon, 30 Dec 2024 18:56:31 +0000 (00:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Jan 2025 14:38:56 +0000 (15:38 +0100)
commit26098b787c3fd1de6ab40d26b6283c4a5e24543a
tree84620e789ca5b644eda47520ac3412eea8c69e63
parent44aaeb2c0843ea37f6235c173d2e8f8df3be1704
staging: gpib: ines: Handle gpib_register_driver() errors

The function ines_pcmcia_init_module() can be replaced by calling
pcmcia_register_driver() directly. The error value from this
function is not returned and the previous registering functions
are not unregistered.

The function gpib_register_driver() can fail and similar to
pcmcia_register_driver() function failing, the previous registering
functions are not unregistered.

Replace cb_pcmcia_init_module() with pcmcia_register_driver().
Unregister the gpib and pci register functions if the subsequent
gpib or pcmcia register functions fail and return the error value.
Add pr_err() statements indicating the fail and error value.

Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
Link: https://lore.kernel.org/r/20241230185633.175690-12-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/ines/ines_gpib.c