From: Dave Penkler Date: Fri, 18 Apr 2025 17:34:32 +0000 (+0200) Subject: staging: gpib: Change error code for no listener X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=427ab512c2c8784686738ade287e5eb52bd8292a;p=users%2Fdwmw2%2Flinux.git staging: gpib: Change error code for no listener 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 Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-7-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 1d650cb57cd27..86b98eb1ce692 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; }