aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-11-03 19:23:26 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-04 15:20:06 -0500
commit1620d221842cb2445680be2afbb36272350b4cac (patch)
treee218a261308a9586d5e5c7fe00221d30fac2890a
parent0b0d96281f6d59280094b240ca5046b317ade614 (diff)
[media] af9033: improve read_signal_strength error handling slightly
Check return status after each register access routine and avoid masking return status values. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/dvb-frontends/af9033.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c
index e3bae7737874..3f688dea9f07 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)
876 *strength = u8tmp * 0xffff / 100; 876 *strength = u8tmp * 0xffff / 100;
877 } else { 877 } else {
878 ret = af9033_rd_reg(dev, 0x8000f7, &u8tmp); 878 ret = af9033_rd_reg(dev, 0x8000f7, &u8tmp);
879 ret |= af9033_rd_regs(dev, 0x80f900, buf, 7); 879 if (ret < 0)
880 goto err;
881
882 ret = af9033_rd_regs(dev, 0x80f900, buf, 7);
883 if (ret < 0)
884 goto err;
880 885
881 if (c->frequency <= 300000000) 886 if (c->frequency <= 300000000)
882 gain_offset = 7; /* VHF */ 887 gain_offset = 7; /* VHF */
@@ -901,9 +906,6 @@ static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
901 *strength = tmp * 0xffff / 100; 906 *strength = tmp * 0xffff / 100;
902 } 907 }
903 908
904 if (ret)
905 goto err;
906
907 return 0; 909 return 0;
908 910
909err: 911err: