[PATCH] drm/i2c: tda998x: remove an unecessary check

Dan Carpenter dan.carpenter at oracle.com
Sat Jun 2 07:53:58 UTC 2018


cec_read() returns a u8 so "val" can't be negative.  If there is an
error in cec_read() then it returns zero.

Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 6ebd8842dbcc..86e3aee44686 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -436,9 +436,6 @@ static void cec_enamods(struct tda998x_priv *priv, u8 mods, bool enable)
 {
 	int val = cec_read(priv, REG_CEC_ENAMODS);
 
-	if (val < 0)
-		return;
-
 	if (enable)
 		val |= mods;
 	else


More information about the dri-devel mailing list