From: Bartosz Golaszewski Date: Mon, 2 Jan 2023 14:31:58 +0000 (+0100) Subject: gpiosim: fix error reporting in gpiosim_bank_hog_line() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=936785d36e2971b3d9cccfd51d4a46dd1760597b;p=qemu-gpiodev%2Flibgpiod.git gpiosim: fix error reporting in gpiosim_bank_hog_line() We don't return errno numbers from public functions - we set errno and indicate an error by returning -1 or NULL depending on the function signature. Make gpiosim_bank_hog_line() consistent with that behavior. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/gpiosim/gpiosim.c b/tests/gpiosim/gpiosim.c index f5e910e..f46adfa 100644 --- a/tests/gpiosim/gpiosim.c +++ b/tests/gpiosim/gpiosim.c @@ -1058,7 +1058,8 @@ GPIOSIM_API int gpiosim_bank_hog_line(struct gpiosim_bank *bank, dir = "output-low"; break; default: - return -EINVAL; + errno = EINVAL; + return -1; } if (!dev_check_pending(bank->dev))