This patch makes the following fixes in check_firmware(): - there is only one BASE and INIT1 firmware for XC4000 - loading SCODE is needed also for FM radio Signed-off-by: Istvan Varga <istvan_v@xxxxxxxxxx>
diff -uNr xc4000_orig/drivers/media/common/tuners/xc4000.c xc4000/drivers/media/common/tuners/xc4000.c --- xc4000_orig/drivers/media/common/tuners/xc4000.c 2011-06-04 13:23:07.000000000 +0200 +++ xc4000/drivers/media/common/tuners/xc4000.c 2011-06-04 13:34:17.000000000 +0200 @@ -904,7 +904,7 @@ struct xc4000_priv *priv = fe->tuner_priv; struct firmware_properties new_fw; int rc = 0, is_retry = 0; - u16 version, hwmodel; + u16 version = 0, hwmodel; v4l2_std_id std0; u8 hw_major, hw_minor, fw_major, fw_minor; @@ -946,8 +946,7 @@ } /* No need to reload base firmware if it matches */ - if (((BASE | new_fw.type) & BASE_TYPES) == - (priv->cur_fw.type & BASE_TYPES)) { + if (priv->cur_fw.type & BASE) { dprintk(1, "BASE firmware not changed.\n"); goto skip_base; } @@ -962,7 +961,7 @@ /* BASE firmwares are all std0 */ std0 = 0; - rc = load_firmware(fe, BASE | new_fw.type, &std0); + rc = load_firmware(fe, BASE, &std0); if (rc < 0) { printk("Error %d while loading base firmware\n", rc); goto fail; @@ -971,10 +970,9 @@ /* Load INIT1, if needed */ dprintk(1, "Load init1 firmware, if exists\n"); - rc = load_firmware(fe, BASE | INIT1 | new_fw.type, &std0); + rc = load_firmware(fe, BASE | INIT1, &std0); if (rc == -ENOENT) - rc = load_firmware(fe, (BASE | INIT1 | new_fw.type) & ~F8MHZ, - &std0); + rc = load_firmware(fe, BASE | INIT1, &std0); if (rc < 0 && rc != -ENOENT) { tuner_err("Error %d while loading init1 firmware\n", rc); @@ -1008,9 +1006,6 @@ goto check_device; } - if (new_fw.type & FM) - goto check_device; - /* Load SCODE firmware, if exists */ rc = load_scode(fe, new_fw.type | new_fw.scode_table, &new_fw.id, new_fw.int_freq, new_fw.scode_nr);