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

The function cb_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 to indicate the fail and also the error
value.

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