public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dave Penkler <dpenkler@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: marcello.carla@gmx.com, Dave Penkler <dpenkler@gmail.com>
Subject: [PATCH 6/8] staging: gpib: Change error code for no listener
Date: Fri, 18 Apr 2025 19:34:32 +0200	[thread overview]
Message-ID: <20250418173434.2892-7-dpenkler@gmail.com> (raw)
In-Reply-To: <20250418173434.2892-1-dpenkler@gmail.com>

When doing a write a test is made to see whether there are any
listeners. The code was returning ENODEV which is incorrect.
The user library translates ENOTCONN to a user level no listener
error code.

Change the error code to ENOTCONN.

Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver")
Tested-by: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
---
 drivers/staging/gpib/gpio/gpib_bitbang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c
index 1d650cb57cd2..86b98eb1ce69 100644
--- a/drivers/staging/gpib/gpio/gpib_bitbang.c
+++ b/drivers/staging/gpib/gpio/gpib_bitbang.c
@@ -516,7 +516,7 @@ static int bb_write(struct gpib_board *board, u8 *buffer, size_t length,
 		   gpiod_get_value(NRFD), gpiod_get_value(NDAC));
 
 	if (gpiod_get_value(NRFD) && gpiod_get_value(NDAC)) { /* check for listener */
-		retval = -ENODEV;
+		retval = -ENOTCONN;
 		goto write_end;
 	}
 
-- 
2.49.0


  parent reply	other threads:[~2025-04-18 17:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18 17:34 [PATCH 0/8] staging: gpib: Fixes and cleanup for gpio driver Dave Penkler
2025-04-18 17:34 ` [PATCH 1/8] staging: gpib: Fix request_system_control in gpio Dave Penkler
2025-04-18 17:34 ` [PATCH 2/8] staging: gpib: Fix setting controller-in-charge Dave Penkler
2025-04-18 17:34 ` [PATCH 3/8] staging: gpib: Enable SRQ irq on request_system_control Dave Penkler
2025-04-18 17:34 ` [PATCH 4/8] staging: gpib: Remove dependency on LED subsystem Dave Penkler
2025-04-18 17:34 ` [PATCH 5/8] staging: gpib: Remove atn_asserted global variable Dave Penkler
2025-04-18 17:34 ` Dave Penkler [this message]
2025-04-18 17:34 ` [PATCH 7/8] staging: gpib: Cleanup allocate_gpios code Dave Penkler
2025-04-18 17:34 ` [PATCH 8/8] staging: gpib: Set control lines in attach Dave Penkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250418173434.2892-7-dpenkler@gmail.com \
    --to=dpenkler@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=marcello.carla@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox