Skip to content

Commit

Permalink
drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_r…
Browse files Browse the repository at this point in the history
…ead()

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: 2f733d6 ("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>
(cherry picked from commit 85b4587)
  • Loading branch information
Dan Carpenter authored and anholt committed Nov 21, 2017
1 parent 4b6cd77 commit e8c2100
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,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->bridge_i2c, reg);
}
Expand Down

0 comments on commit e8c2100

Please sign in to comment.