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>
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;
}