diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-04-21 11:23:41 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-04-29 12:04:38 +0200 |
commit | e5ad7db4b2f35aaed796669b47e24c6d79cab3d0 (patch) | |
tree | d5fc2cf22e0ddb0b89bfe34996f012a204bb58d1 /drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | |
parent | fcab45adb853a668e9b2f653e792770399bb441a (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index 68d4644ac2dc..126e1517ade2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -282,7 +282,7 @@ static const struct drm_connector_funcs sun4i_hdmi_connector_funcs = { }; #ifdef CONFIG_DRM_SUN4I_HDMI_CEC -static bool sun4i_hdmi_cec_pin_read(struct cec_adapter *adap) +static int sun4i_hdmi_cec_pin_read(struct cec_adapter *adap) { struct sun4i_hdmi *hdmi = cec_get_drvdata(adap); |