kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_read()
@ 2017-10-20  0:28 Dan Carpenter
  2017-10-31  0:02 ` Eric Anholt
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-10-20  0:28 UTC (permalink / raw)
  To: Thierry Reding, Eric Anholt; +Cc: kernel-janitors, dri-devel

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>

diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 890fd6ff397c..d964d454e4ae 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -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);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_read()
  2017-10-20  0:28 [PATCH] drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_read() Dan Carpenter
@ 2017-10-31  0:02 ` Eric Anholt
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Anholt @ 2017-10-31  0:02 UTC (permalink / raw)
  To: Dan Carpenter, Thierry Reding; +Cc: David Airlie, dri-devel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

Dan Carpenter <dan.carpenter@oracle.com> writes:

> 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.

Reviewed and applied to -next.  Thanks!

(Not to -fixes because we're late in the cycle, we don't have an
upstream DT exposing the panel, and it seems unlikely that the error
value here would happen to collide with one of the 2 values of a valid
firmware revision)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-31  0:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-20  0:28 [PATCH] drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_read() Dan Carpenter
2017-10-31  0:02 ` Eric Anholt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).