Skip to content

staging: gpib: Handle gpib_register_driver() errors

Nihar Chaithanya linux-staging lkml oe-kbuild-all 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest15 patches 0 repliesNew
  2. v515 patches 4 repliesSuperseded
  3. v415 patches 4 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15staging: gpib: Modify gpib_register_driver() to return error if it failsdrivers/staging/gpib/common/gpib_os.c drivers/staging/gpib/include/gpibP.h+5 -40 replies
2/15staging: gpib: agilent_82350b: Handle gpib_register_driver() errorsdrivers/staging/gpib/agilent_82350b/agilent_82350b.c+20 -30 replies
3/15staging: gpib: agilent_82357a: Handle gpib_register_driver() errorsdrivers/staging/gpib/agilent_82357a/agilent_82357a.c+14 -20 replies
4/15staging: gpib: cb7210: Handle gpib_register_driver() errorsdrivers/staging/gpib/cb7210/cb7210.c+90 -260 replies
5/15staging: gpib: cec: Handle gpib_register_driver() errorsdrivers/staging/gpib/cec/cec_gpib.c+6 -20 replies
6/15staging: gpib: fluke: Handle gpib_register_driver() errorsdrivers/staging/gpib/eastwood/fluke_gpib.c+27 -50 replies
7/15staging: gpib: fmh: Handle gpib_register_driver() errorsdrivers/staging/gpib/fmh_gpib/fmh_gpib.c+39 -80 replies
8/15staging: gpib: gpio: Return error value from gpib_register_driver()drivers/staging/gpib/gpio/gpib_bitbang.c+6 -10 replies
9/15staging: gpib: hp_82335: Return error value from gpib_register_driver()drivers/staging/gpib/hp_82335/hp82335.c+7 -10 replies
10/15staging: gpib: hp_82341: Handle gpib_register_driver() errorsdrivers/staging/gpib/hp_82341/hp_82341.c+15 -20 replies
11/15staging: gpib: ines: Handle gpib_register_driver() errorsdrivers/staging/gpib/ines/ines_gpib.c+73 -210 replies
12/15staging: gpib: lpvo_usb: Return error value from gpib_register_driver()drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c+5 -10 replies
13/15staging: gpib: ni_usb: Handle gpib_register_driver() errorsdrivers/staging/gpib/ni_usb/ni_usb_gpib.c+13 -20 replies
14/15staging: gpib: pc2: Handle gpib_register_driver() errorsdrivers/staging/gpib/pc2/pc2_gpib.c+34 -40 replies
15/15staging: gpib: tnt4882: Handle gpib_register_driver() errorsdrivers/staging/gpib/tnt4882/tnt4882_gpib.c+93 -130 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors

While reviewing the patch for fixing Coverity scan issue from
gpib: cb7210 [1], Greg pointed out that the gpib_register_driver() function can fail and must return an error value if it fails.

This patch series fixes the above issue by changing the return type of gpib_register_driver() function and returning the error value if it fails.

This fix also makes sure that wherever the gpib_register_driver() is called and if it fails - the previous driver register functions are unregistered (if they exist) and the error value is returned. The pr_err() statements are added indicating the fail and the error value.

Thanks,
Nihar

v5 --> v6 : Removed unnecessary pr_info() statements when the drivers are
working properly. Added pr_err() in all cases of the driver registration fail - indicating the failure and also the error value.

v4 --> v5 : Added pr_* statements indicating when the driver register
functions fail or if the module is initialized without errors.

v3 --> v4 : Made the v3 patch into series and also fixed an error in
v3 [2]. Each patch in this series is a fix for particular driver handling the gpib_register_driver() error.

v2 --> v3 : Modified the gpib_register_driver() to return error code,
added error handling to all the places that the gpib_register_driver() is called.

v1 --> v2 : Replaced the redundant cb_pcmcia_init_module() with
pcmcia_register_driver().

Link to v5 : https://lore.kernel.org/all/[email protected]/
Link to v4 : https://lore.kernel.org/all/[email protected]/
Link to v3 : https://lore.kernel.org/all/[email protected]/
Link to v2 : https://lore.kernel.org/all/[email protected]/
Link to v1 : https://lore.kernel.org/all/[email protected]/

[1] https://lore.kernel.org/all/2024122133-outskirts-causing-099a@gregkh/
[2] https://lore.kernel.org/all/[email protected]/

Nihar Chaithanya (15):
staging: gpib: Modify gpib_register_driver() to return error if it
fails
staging: gpib: agilent_82350b: Handle gpib_register_driver() errors
staging: gpib: agilent_82357a: Handle gpib_register_driver() errors
staging: gpib: cb7210: Handle gpib_register_driver() errors
staging: gpib: cec: Handle gpib_register_driver() errors
staging: gpib: fluke: Handle gpib_register_driver() errors
staging: gpib: fmh: Handle gpib_register_driver() errors
staging: gpib: gpio: Return error value from gpib_register_driver()
staging: gpib: hp_82335: Return error value from
gpib_register_driver()
staging: gpib: hp_82341: Handle gpib_register_driver() errors
staging: gpib: ines: Handle gpib_register_driver() errors
staging: gpib: lpvo_usb: Return error value from
gpib_register_driver()
staging: gpib: ni_usb: Handle gpib_register_driver() errors
staging: gpib: pc2: Handle gpib_register_driver() errors
staging: gpib: tnt4882: Handle gpib_register_driver() errors

 .../gpib/agilent_82350b/agilent_82350b.c      |  23 +++-
 .../gpib/agilent_82357a/agilent_82357a.c      |  16 ++-
 drivers/staging/gpib/cb7210/cb7210.c          | 116 ++++++++++++++----
 drivers/staging/gpib/cec/cec_gpib.c           |   8 +-
 drivers/staging/gpib/common/gpib_os.c         |   7 +-
 drivers/staging/gpib/eastwood/fluke_gpib.c    |  32 ++++-
 drivers/staging/gpib/fmh_gpib/fmh_gpib.c      |  47 +++++--
 drivers/staging/gpib/gpio/gpib_bitbang.c      |   7 +-
 drivers/staging/gpib/hp_82335/hp82335.c       |   8 +-
 drivers/staging/gpib/hp_82341/hp_82341.c      |  17 ++-
 drivers/staging/gpib/include/gpibP.h          |   2 +-
 drivers/staging/gpib/ines/ines_gpib.c         |  94 ++++++++++----
 .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c        |   6 +-
 drivers/staging/gpib/ni_usb/ni_usb_gpib.c     |  15 ++-
 drivers/staging/gpib/pc2/pc2_gpib.c           |  38 +++++-
 drivers/staging/gpib/tnt4882/tnt4882_gpib.c   | 106 ++++++++++++++--
 16 files changed, 447 insertions(+), 95 deletions(-)
Signature · 1 line
2.34.1