gpib: cleanup and fix error code
Subsystems (2)
Dave Penkler
maintainercover gpib: cleanup and fix error code
Patch 1: Removes some useless old code
Patch 2: Fixes the error return code on invalid ioctl commands
Dave Penkler (2):
gpib: Remove useless code
gpib: Fix inappropriate ioctl error return
drivers/gpib/common/gpib_os.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
Signature · 1 line
2.53.0
Dave Penkler
maintainerPATCH 1/2 gpib: Remove useless code
This code is a hangover from an earlier approach in the driver where the driver modules were called gpibXX It no longer serves any purpose.
Signed-off-by Dave Penkler <[email protected]>
--- drivers/gpib/common/gpib_os.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpib/common/gpib_os.c +0 -7
@@ -544,13 +544,6 @@ int ibopen(struct inode *inode, struct file *filep) priv = filep->private_data;init_gpib_file_private ((struct gpib_file_private *)filep->private_data); -if (board->use_count ==0 ) { -int retval; - - retval =request_module ("gpib%i" , minor); -if (retval) -dev_dbg (board->gpib_dev,"request module returned %i\n" , retval); - }if (board->interface) {if (!try_module_get (board->provider_module)) {dev_err (board->gpib_dev,"try_module_get() failed\n" );
Signature · 1 line
2.53.0
Dave Penkler
maintainerPATCH 2/2 gpib: Fix inappropriate ioctl error return
In reply to Dave PenklerThe driver was returning -ENOTTY in the case the ioctl command was not recognised. Change it to -EBADRQC.
Fixes 9dde4559e939 ("staging: gpib: Add GPIB common core driver")
Signed-off-by Dave Penkler <[email protected]>
--- drivers/gpib/common/gpib_os.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpib/common/gpib_os.c +1 -2
@@ -606,7 +606,7 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg)unsigned int minor =iminor (file_inode (filep));struct gpib_board *board;struct gpib_file_private *file_priv = filep->private_data; -long retval = -ENOTTY ; +long retval = -EBADRQC ;if (minor >=GPIB_MAX_NUM_BOARDS ) {pr_err ("gpib: invalid minor number of device file\n" );
@@ -799,7 +799,6 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg)mutex_unlock (&board->big_gpib_mutex);return write_ioctl (file_priv, board, arg);default : - retval = -ENOTTY ; goto done; }
Signature · 1 line
2.53.0