aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorIstvan Varga <istvan_v@mailbox.hu>2011-06-04 10:56:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:52:34 -0400
commitffce6266c8be9076947462c688ad3a3099c83eeb (patch)
treeb8fc06dd8dbeea63c24a8b77f2955a4eb319121d /drivers/media/common
parent3db9570482f368cd2f62c258802da21667ec6198 (diff)
[media] xc4000: simplified load_scode
Removed unused code from load_scode() (all SCODE firmwares are assumed to have the HAS_IF bit set). Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/xc4000.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c
index 811519a49f59..d83da50ebb70 100644
--- a/drivers/media/common/tuners/xc4000.c
+++ b/drivers/media/common/tuners/xc4000.c
@@ -780,8 +780,7 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
780 p += sizeof(size); 780 p += sizeof(size);
781 781
782 if (!size || size > endp - p) { 782 if (!size || size > endp - p) {
783 printk("Firmware type "); 783 printk("Firmware type (%x), id %llx is corrupted "
784 printk("(%x), id %llx is corrupted "
785 "(size=%d, expected %d)\n", 784 "(size=%d, expected %d)\n",
786 type, (unsigned long long)id, 785 type, (unsigned long long)id,
787 (unsigned)(endp - p), size); 786 (unsigned)(endp - p), size);
@@ -839,10 +838,10 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type,
839 v4l2_std_id *id, __u16 int_freq, int scode) 838 v4l2_std_id *id, __u16 int_freq, int scode)
840{ 839{
841 struct xc4000_priv *priv = fe->tuner_priv; 840 struct xc4000_priv *priv = fe->tuner_priv;
842 int pos, rc; 841 int pos, rc;
843 unsigned char *p; 842 unsigned char *p;
844 u8 scode_buf[13]; 843 u8 scode_buf[13];
845 u8 indirect_mode[5]; 844 u8 indirect_mode[5];
846 845
847 dprintk(1, "%s called int_freq=%d\n", __func__, int_freq); 846 dprintk(1, "%s called int_freq=%d\n", __func__, int_freq);
848 847
@@ -862,18 +861,9 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type,
862 861
863 p = priv->firm[pos].ptr; 862 p = priv->firm[pos].ptr;
864 863
865 if (priv->firm[pos].type & HAS_IF) { 864 if (priv->firm[pos].size != 12 * 16 || scode >= 16)
866 if (priv->firm[pos].size != 12 * 16 || scode >= 16) 865 return -EINVAL;
867 return -EINVAL; 866 p += 12 * scode;
868 p += 12 * scode;
869 } else {
870 /* 16 SCODE entries per file; each SCODE entry is 12 bytes and
871 * has a 2-byte size header in the firmware format. */
872 if (priv->firm[pos].size != 14 * 16 || scode >= 16 ||
873 le16_to_cpu(*(__u16 *)(p + 14 * scode)) != 12)
874 return -EINVAL;
875 p += 14 * scode + 2;
876 }
877 867
878 tuner_info("Loading SCODE for type="); 868 tuner_info("Loading SCODE for type=");
879 dump_firm_type_and_int_freq(priv->firm[pos].type, 869 dump_firm_type_and_int_freq(priv->firm[pos].type,