summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHartmut Hackmann <hartmut.hackmann@t-online.de>2007-01-25 01:24:52 +0100
committerHartmut Hackmann <hartmut.hackmann@t-online.de>2007-01-25 01:24:52 +0100
commit0e0b0e152524cefd17b5c23c0d4e93f9ed0e35b2 (patch)
treee6dd1fd3fa0dc0a95ae507237a5b45b9a5f61031
parente7f27ae2ed4e6113922b93149b17bf1025cf2d75 (diff)
downloadmediapointer-dvb-s2-0e0b0e152524cefd17b5c23c0d4e93f9ed0e35b2.tar.gz
mediapointer-dvb-s2-0e0b0e152524cefd17b5c23c0d4e93f9ed0e35b2.tar.bz2
tda1004x: check request firmware for NULL ponter again
From: Hartmut Hackmann <hartmut.hackmann@t-online.de> 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>
-rw-r--r--linux/drivers/media/dvb/frontends/tda1004x.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c
index 782dc4ea3..dbfc94a9c 100644
--- a/linux/drivers/media/dvb/frontends/tda1004x.c
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c
@@ -515,18 +515,24 @@ static int tda10046_fwupload(struct dvb_frontend* fe)
if (tda1004x_check_upload_ok(state) == 0)
return 0;
- /* request the firmware, this will block until someone uploads it */
- printk(KERN_INFO "tda1004x: waiting for firmware upload...\n");
- ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);
- if (ret) {
- /* remain compatible to old bug: try to load with tda10045 image name */
- ret = state->config->request_firmware(fe, &fw, TDA10045_DEFAULT_FIRMWARE);
+ if (state->config->request_firmware != NULL) {
+ /* request the firmware, this will block until someone uploads it */
+ printk(KERN_INFO "tda1004x: waiting for firmware upload...\n");
+ ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);
if (ret) {
- printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");
- return ret;
- } else
- printk(KERN_INFO "tda1004x: please rename the firmware file to %s\n",
- TDA10046_DEFAULT_FIRMWARE);
+ /* remain compatible to old bug: try to load with tda10045 image name */
+ ret = state->config->request_firmware(fe, &fw, TDA10045_DEFAULT_FIRMWARE);
+ if (ret) {
+ printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");
+ return ret;
+ } else {
+ printk(KERN_INFO "tda1004x: please rename the firmware file to %s\n",
+ 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
ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
@@ -574,7 +580,7 @@ static int tda1004x_decode_fec(int tdafec)
return -1;
}
-int tda1004x_write(struct dvb_frontend* fe, u8 *buf, int len)
+static int tda1004x_write(struct dvb_frontend* fe, u8 *buf, int len)
{
struct tda1004x_state* state = fe->demodulator_priv;