diff options
author | Johannes Stezenbach <devnull@localhost> | 2004-02-10 17:33:01 +0000 |
---|---|---|
committer | Johannes Stezenbach <devnull@localhost> | 2004-02-10 17:33:01 +0000 |
commit | 02bd082116e4aa5d890757253ca5fa70386323e0 (patch) | |
tree | cf6fff5f8881344ae85ae198a81e506da63071c3 | |
parent | 21059300be791fe4d0c13b6ef5fdd534e7f6b44e (diff) | |
download | mediapointer-dvb-s2-02bd082116e4aa5d890757253ca5fa70386323e0.tar.gz mediapointer-dvb-s2-02bd082116e4aa5d890757253ca5fa70386323e0.tar.bz2 |
bail out early if booting the ARM failed
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_hw.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_hw.h | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index e4c9e6744..f53c989f6 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -1433,7 +1433,10 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d /* load firmware into AV7110 cards */ av7110_bootarm(av7110); - av7110_firmversion(av7110); + if (av7110_firmversion(av7110)) { + ret = -EIO; + goto err2; + } if (FW_VERSION(av7110->arm_app)<0x2501) printk ("av7110: Warning, firmware version 0x%04x is too old. " @@ -1504,6 +1507,9 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d av7110_num++; return 0; +err2: + av7110_ca_exit(av7110); + av7110_av_exit(av7110); err: if (NULL != av7110 ) { kfree(av7110); diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c index bd8eca1f7..52bda9aeb 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.c +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c @@ -515,14 +515,18 @@ int av7110_fw_query(struct av7110 *av7110, u16 tag, u16* buf, s16 length) ****************************************************************************/ /* get version of the firmware ROM, RTSL, video ucode and ARM application */ -void av7110_firmversion(struct av7110 *av7110) +int av7110_firmversion(struct av7110 *av7110) { u16 buf[20]; u16 tag = ((COMTYPE_REQUEST << 8) + ReqVersion); DEB_EE(("av7110: %p\n", av7110)); - av7110_fw_query(av7110, tag, buf, 16); + if (av7110_fw_query(av7110, tag, buf, 16)) { + printk("DVB: AV7110-%d: ERROR: Failed to boot firmware\n", + av7110->dvb_adapter->num); + return -EIO; + } av7110->arm_fw = (buf[0] << 16) + buf[1]; av7110->arm_rtsl = (buf[2] << 16) + buf[3]; @@ -542,7 +546,7 @@ void av7110_firmversion(struct av7110 *av7110) printk("DVB: AV711%d(%d) - no firmware support for CI link layer interface\n", av7110->avtype, av7110->dvb_adapter->num); - return; + return 0; } diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.h b/linux/drivers/media/dvb/ttpci/av7110_hw.h index c0f539b93..aa674b84e 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.h +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.h @@ -362,7 +362,7 @@ enum av7110_command_type { extern void av7110_reset_arm(struct av7110 *av7110); extern int av7110_bootarm(struct av7110 *av7110); -extern void av7110_firmversion(struct av7110 *av7110); +extern int av7110_firmversion(struct av7110 *av7110); #define FW_CI_LL_SUPPORT(arm_app) ((arm_app) & 0x80000000) #define FW_VERSION(arm_app) ((arm_app) & 0x0000FFFF) |