]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
staging: gpib: Change error code for no listener
authorDave Penkler <dpenkler@gmail.com>
Fri, 18 Apr 2025 17:34:32 +0000 (19:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 14:08:26 +0000 (16:08 +0200)
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>
Link: https://lore.kernel.org/r/20250418173434.2892-7-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/gpio/gpib_bitbang.c

index 1d650cb57cd273e07d7e72633b8dabbe059c49b6..86b98eb1ce692040f7a03fd4cd9fad3f6a6ecccd 100644 (file)
@@ -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;
        }