[PATCH 3/6] af9033: improve read_signal_strength error handling slightly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check return status after each register access routine and avoid
masking return status values.

Signed-off-by: Antti Palosaari <crope@xxxxxx>
---
 drivers/media/dvb-frontends/af9033.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c
index e3bae77..3f688de 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -876,7 +876,12 @@ static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
 		*strength = u8tmp * 0xffff / 100;
 	} else {
 		ret = af9033_rd_reg(dev, 0x8000f7, &u8tmp);
-		ret |= af9033_rd_regs(dev, 0x80f900, buf, 7);
+		if (ret < 0)
+			goto err;
+
+		ret = af9033_rd_regs(dev, 0x80f900, buf, 7);
+		if (ret < 0)
+			goto err;
 
 		if (c->frequency <= 300000000)
 			gain_offset = 7; /* VHF */
@@ -901,9 +906,6 @@ static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
 		*strength = tmp * 0xffff / 100;
 	}
 
-	if (ret)
-		goto err;
-
 	return 0;
 
 err:
-- 
http://palosaari.fi/

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux