V4L/DVB (5315): Tda1004x: check request firmware for NULL ponter again

In older versions, this was used to decide whether to boot from
eeprom or file. This is no longer necessary but the check helps to avoid
an oops with misconfigured cards.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Hartmut Hackmann 2007-04-27 12:31:13 -03:00 committed by Mauro Carvalho Chehab
parent 58ef4f924c
commit f4546e702a

View file

@ -515,6 +515,7 @@ static int tda10046_fwupload(struct dvb_frontend* fe)
if (tda1004x_check_upload_ok(state) == 0) if (tda1004x_check_upload_ok(state) == 0)
return 0; return 0;
if (state->config->request_firmware != NULL) {
/* request the firmware, this will block until someone uploads it */ /* request the firmware, this will block until someone uploads it */
printk(KERN_INFO "tda1004x: waiting for firmware upload...\n"); printk(KERN_INFO "tda1004x: waiting for firmware upload...\n");
ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE); ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);
@ -524,10 +525,15 @@ static int tda10046_fwupload(struct dvb_frontend* fe)
if (ret) { if (ret) {
printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n"); printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");
return ret; return ret;
} else } else {
printk(KERN_INFO "tda1004x: please rename the firmware file to %s\n", printk(KERN_INFO "tda1004x: please rename the firmware file to %s\n",
TDA10046_DEFAULT_FIRMWARE); TDA10046_DEFAULT_FIRMWARE);
} }
}
} else {
printk(KERN_ERR "tda1004x: no request function defined, can't upload from file\n");
return -EIO;
}
tda1004x_write_mask(state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST 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); ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
release_firmware(fw); release_firmware(fw);