923cdf24392a5a71cdf51db34daa9e9a61d2473c
[openwrt/staging/noltari.git] /
1 From 5659b5b9d46a236f53217e6686209863960442e3 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Fri, 20 Oct 2017 03:28:45 +0300
4 Subject: [PATCH 201/454] drm/panel: rpi-touchscreen: propagate errors in
5 rpi_touchscreen_i2c_read()
6
7 There is one caller which checks whether rpi_touchscreen_i2c_read()
8 returns negative error codes. Currently it can't because negative
9 error codes are truncated to u8, but that's easy to fix if we change the
10 type to int.
11
12 Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
13 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
14 Signed-off-by: Eric Anholt <eric@anholt.net>
15 Link: https://patchwork.freedesktop.org/patch/msgid/20171020002845.kar2wg7gqxg7tzqi@mwanda
16 Reviewed-by: Eric Anholt <eric@anholt.net>
17 (cherry picked from commit 85b4587f8e94143bafb8b6a4003a5187b9a8753d)
18 ---
19 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
23 +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
24 @@ -243,7 +243,7 @@ static struct rpi_touchscreen *panel_to_
25 return container_of(panel, struct rpi_touchscreen, base);
26 }
27
28 -static u8 rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg)
29 +static int rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg)
30 {
31 return i2c_smbus_read_byte_data(ts->bridge_i2c, reg);
32 }