if (tda1004x_check_upload_ok(state, 0x20) == 0) 
if (tda1004x_check_upload_ok(state, state->fw_version) == 0) 
static int tda10046_fwupload(struct dvb_frontend* fe){	struct tda1004x_state* state = fe->demodulator_priv;	unsigned long timeout;	int ret;	const struct firmware *fw;	/* reset + wake up chip */	tda1004x_write_mask(state, TDA1004X_CONFC4, 1, 0);	tda1004x_write_mask(state, TDA10046H_CONF_TRISTATE1, 1, 0);	msleep(100);	/* don't re-upload unless necessary */	if (tda1004x_check_upload_ok(state, 0x20) == 0)		return 0;	/* request the firmware, this will block until someone uploads it */	printk("tda1004x: waiting for firmware upload (%s)...\n", TDA10046_DEFAULT_FIRMWARE);	ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);	if (ret) {		printk("tda1004x: no firmware upload (timeout or file not found?)\n");		return ret;	}	/* set parameters */	tda1004x_write_byteI(state, TDA10046H_CONFPLL2, 10);	tda1004x_write_byteI(state, TDA10046H_CONFPLL3, state->config->n_i2c);	tda1004x_write_byteI(state, TDA10046H_FREQ_OFFSET, 99);	tda1004x_write_byteI(state, TDA10046H_FREQ_PHY2_MSB, 0xd4);	tda1004x_write_byteI(state, TDA10046H_FREQ_PHY2_LSB, 0x2c);	tda1004x_write_mask(state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST	ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);	if (ret)		return ret;	printk("tda1004x: firmware upload complete\n");	/* wait for DSP to initialise */	timeout = jiffies + HZ;	while (!(tda1004x_read_byte(state, TDA1004X_STATUS_CD) & 0x20)) {		if (time_after(jiffies, timeout)) {			printk("tda1004x: DSP failed to initialised.\n");			return -EIO;		}		msleep(1);	}	return tda1004x_check_upload_ok(state, 0x20);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/71e3420111530273f2b26fabfac4d021c2a2b79f/tda1004x.c/clean/drivers/media/dvb/frontends/tda1004x.c