summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/mb86a20s.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-01-24 17:16:17 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-24 17:28:32 +0100
commitf67102c49a123b32a4469b28407feb52b37144f5 (patch)
tree07ca8929758c54c612b49b087011daaeac5b28d5 /drivers/media/dvb-frontends/mb86a20s.c
parent[media] mb86a20s: add a logic for post-BER measurement (diff)
downloadlinux-f67102c49a123b32a4469b28407feb52b37144f5.tar.xz
linux-f67102c49a123b32a4469b28407feb52b37144f5.zip
[media] mb86a20s: remove global BER/PER counters if per-layer counters vanish
If, for any reason, all per-layers counters stop, remove the corresponding global counter. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends/mb86a20s.c')
-rw-r--r--drivers/media/dvb-frontends/mb86a20s.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c
index ed39ee13a5ad..f19cd7367040 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -1604,7 +1604,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
"%s: Can't get BER for layer %c (error %d).\n",
__func__, 'A' + i, rc);
}
-
if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
pre_ber_layers++;
@@ -1627,7 +1626,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
"%s: Can't get BER for layer %c (error %d).\n",
__func__, 'A' + i, rc);
}
-
if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
post_ber_layers++;
@@ -1652,7 +1650,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
__func__, 'A' + i, rc);
}
-
if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
per_layers++;
@@ -1686,6 +1683,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
c->pre_bit_error.stat[0].uvalue = t_pre_bit_error;
c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
c->pre_bit_count.stat[0].uvalue = t_pre_bit_count;
+ } else {
+ c->pre_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+ c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
}
/*
@@ -1704,6 +1704,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
c->post_bit_error.stat[0].uvalue = t_post_bit_error;
c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
c->post_bit_count.stat[0].uvalue = t_post_bit_count;
+ } else {
+ c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+ c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
}
if (per_layers) {
@@ -1718,6 +1721,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
c->block_error.stat[0].uvalue = t_block_error;
c->block_count.stat[0].scale = FE_SCALE_COUNTER;
c->block_count.stat[0].uvalue = t_block_count;
+ } else {
+ c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+ c->block_count.stat[0].scale = FE_SCALE_COUNTER;
}
return rc;