[PATCH 2/2] gpib: Fix inappropriate ioctl error return

Dave Penkler
2026-04-11T10:20:49Z

The 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 <dpenkler@gmail.com>
---
drivers/gpib/common/gpib_os.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpib/common/gpib_os.c b/drivers/gpib/common/gpib_os.c
index fca181b8c749..aafc4439b2fa 100644
--- a/drivers/gpib/common/gpib_os.c
+++ b/drivers/gpib/common/gpib_os.c
@@ -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;
}

--
2.53.0