Re: [PATCH] HID: cp2112: fix setter callbacks return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 4 Sep 2025 18:42:07 +0200, "Sébastien Szymanski"
<sebastien.szymanski@xxxxxxxxxxxx> said:
> Since commit 6485543488a6 ("HID: cp2112: use new line value setter
> callbacks"), setting a GPIO value always fails with error -EBADE.
>
> That's because the returned value by the setter callbacks is the
> returned value by the hid_hw_raw_request() function which is the number of
> bytes sent on success or a negative value on error. The function
> gpiochip_set() returns -EBADE if the setter callbacks return a value >
> 0.
>
> Fix this by making the setter callbacks return 0 on success or a negative
> value on error.
>
> While at it, use the returned value by cp2112_gpio_set_unlocked() in the
> direction_output callback.
>
> Fixes: 6485543488a6 ("HID: cp2112: use new line value setter callbacks")
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@xxxxxxxxxxxx>
> ---

Eek! With the number of conversions it was bound to happen to some drivers
since I can't really functionally test most of them. :(

Thanks for spotting it and fixing it!

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux