]> git.baikalelectronics.ru Git - kernel.git/commit
media: cec-gpio: handle gpiod_get_value errors correctly
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 21 Apr 2020 09:23:41 +0000 (11:23 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 29 Apr 2020 10:04:38 +0000 (12:04 +0200)
commita26e1f9e7c3f125642f596048713cd2cd4b6c27d
treed5fc2cf22e0ddb0b89bfe34996f012a204bb58d1
parent92ce4928669a5df17c8d4ccc084d3e3d46e6d463
media: cec-gpio: handle gpiod_get_value errors correctly

gpiod_get_value() can return negative values if an error occurs.
In several places this error code was ignored.

Ensure that errors codes are handled correctly throughout the CEC
pin framework and CEC pin drivers.

The return code of the cec_pin_ops read() callback had to be changed
from 'bool' to 'int', which mean the prototype of that callback in the
sun4i drm driver also had to be changed.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
drivers/media/cec/platform/cec-gpio/cec-gpio.c
include/media/cec-pin.h