All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] gpib: cleanup and fix error code
@ 2026-04-11 10:20 Dave Penkler
  2026-04-11 10:20 ` [PATCH 1/2] gpib: Remove useless code Dave Penkler
  2026-04-11 10:20 ` [PATCH 2/2] gpib: Fix inappropriate ioctl error return Dave Penkler
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Penkler @ 2026-04-11 10:20 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: stable, Dave Penkler

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(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] gpib: Remove useless code
  2026-04-11 10:20 [PATCH 0/2] gpib: cleanup and fix error code Dave Penkler
@ 2026-04-11 10:20 ` Dave Penkler
  2026-04-11 10:20 ` [PATCH 2/2] gpib: Fix inappropriate ioctl error return Dave Penkler
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Penkler @ 2026-04-11 10:20 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: stable, Dave Penkler

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

diff --git a/drivers/gpib/common/gpib_os.c b/drivers/gpib/common/gpib_os.c
index 2b4ec6aa893b..fca181b8c749 100644
--- a/drivers/gpib/common/gpib_os.c
+++ b/drivers/gpib/common/gpib_os.c
@@ -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");
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] gpib: Fix inappropriate ioctl error return
  2026-04-11 10:20 [PATCH 0/2] gpib: cleanup and fix error code Dave Penkler
  2026-04-11 10:20 ` [PATCH 1/2] gpib: Remove useless code Dave Penkler
@ 2026-04-11 10:20 ` Dave Penkler
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Penkler @ 2026-04-11 10:20 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: stable, Dave Penkler

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-11 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11 10:20 [PATCH 0/2] gpib: cleanup and fix error code Dave Penkler
2026-04-11 10:20 ` [PATCH 1/2] gpib: Remove useless code Dave Penkler
2026-04-11 10:20 ` [PATCH 2/2] gpib: Fix inappropriate ioctl error return Dave Penkler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.