aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-01-24 11:16:17 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-24 11:28:32 -0500
commitf67102c49a123b32a4469b28407feb52b37144f5 (patch)
tree07ca8929758c54c612b49b087011daaeac5b28d5
parentd9b6f08a7f756d2d5105f5aaf23c326f41a0683b (diff)
[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>
-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)
1604 "%s: Can't get BER for layer %c (error %d).\n", 1604 "%s: Can't get BER for layer %c (error %d).\n",
1605 __func__, 'A' + i, rc); 1605 __func__, 'A' + i, rc);
1606 } 1606 }
1607
1608 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE) 1607 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
1609 pre_ber_layers++; 1608 pre_ber_layers++;
1610 1609
@@ -1627,7 +1626,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
1627 "%s: Can't get BER for layer %c (error %d).\n", 1626 "%s: Can't get BER for layer %c (error %d).\n",
1628 __func__, 'A' + i, rc); 1627 __func__, 'A' + i, rc);
1629 } 1628 }
1630
1631 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE) 1629 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
1632 post_ber_layers++; 1630 post_ber_layers++;
1633 1631
@@ -1652,7 +1650,6 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
1652 __func__, 'A' + i, rc); 1650 __func__, 'A' + i, rc);
1653 1651
1654 } 1652 }
1655
1656 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE) 1653 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
1657 per_layers++; 1654 per_layers++;
1658 1655
@@ -1686,6 +1683,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
1686 c->pre_bit_error.stat[0].uvalue = t_pre_bit_error; 1683 c->pre_bit_error.stat[0].uvalue = t_pre_bit_error;
1687 c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER; 1684 c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
1688 c->pre_bit_count.stat[0].uvalue = t_pre_bit_count; 1685 c->pre_bit_count.stat[0].uvalue = t_pre_bit_count;
1686 } else {
1687 c->pre_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
1688 c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
1689 } 1689 }
1690 1690
1691 /* 1691 /*
@@ -1704,6 +1704,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
1704 c->post_bit_error.stat[0].uvalue = t_post_bit_error; 1704 c->post_bit_error.stat[0].uvalue = t_post_bit_error;
1705 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; 1705 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
1706 c->post_bit_count.stat[0].uvalue = t_post_bit_count; 1706 c->post_bit_count.stat[0].uvalue = t_post_bit_count;
1707 } else {
1708 c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
1709 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
1707 } 1710 }
1708 1711
1709 if (per_layers) { 1712 if (per_layers) {
@@ -1718,6 +1721,9 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe)
1718 c->block_error.stat[0].uvalue = t_block_error; 1721 c->block_error.stat[0].uvalue = t_block_error;
1719 c->block_count.stat[0].scale = FE_SCALE_COUNTER; 1722 c->block_count.stat[0].scale = FE_SCALE_COUNTER;
1720 c->block_count.stat[0].uvalue = t_block_count; 1723 c->block_count.stat[0].uvalue = t_block_count;
1724 } else {
1725 c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
1726 c->block_count.stat[0].scale = FE_SCALE_COUNTER;
1721 } 1727 }
1722 1728
1723 return rc; 1729 return rc;