]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_read()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Oct 2017 00:28:45 +0000 (03:28 +0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 19 Mar 2018 23:40:51 +0000 (20:40 -0300)
BugLink: http://bugs.launchpad.net/bugs/1756978
[ Upstream commit 85b4587f8e94143bafb8b6a4003a5187b9a8753d ]

There is one caller which checks whether rpi_touchscreen_i2c_read()
returns negative error codes.  Currently it can't because negative
error codes are truncated to u8, but that's easy to fix if we change the
type to int.

Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20171020002845.kar2wg7gqxg7tzqi@mwanda
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c

index 890fd6ff397c4bb4248ff2f843d7ef033ce9e507..d964d454e4aeae3c2b1b94b39eea939c40bd2c8e 100644 (file)
@@ -221,7 +221,7 @@ static struct rpi_touchscreen *panel_to_ts(struct drm_panel *panel)
        return container_of(panel, struct rpi_touchscreen, base);
 }
 
-static u8 rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg)
+static int rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg)
 {
        return i2c_smbus_read_byte_data(ts->i2c, reg);
 }