diff options
Diffstat (limited to 'drivers/media/common/tuners/tda18271-fe.c')
-rw-r--r-- | drivers/media/common/tuners/tda18271-fe.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c index b262100ae897..46c080089eb0 100644 --- a/drivers/media/common/tuners/tda18271-fe.c +++ b/drivers/media/common/tuners/tda18271-fe.c | |||
@@ -719,45 +719,56 @@ static int tda18271_ir_cal_init(struct dvb_frontend *fe) | |||
719 | { | 719 | { |
720 | struct tda18271_priv *priv = fe->tuner_priv; | 720 | struct tda18271_priv *priv = fe->tuner_priv; |
721 | unsigned char *regs = priv->tda18271_regs; | 721 | unsigned char *regs = priv->tda18271_regs; |
722 | int ret; | ||
722 | 723 | ||
723 | tda18271_read_regs(fe); | 724 | ret = tda18271_read_regs(fe); |
725 | if (ret < 0) | ||
726 | goto fail; | ||
724 | 727 | ||
725 | /* test IR_CAL_OK to see if we need init */ | 728 | /* test IR_CAL_OK to see if we need init */ |
726 | if ((regs[R_EP1] & 0x08) == 0) | 729 | if ((regs[R_EP1] & 0x08) == 0) |
727 | tda18271_init_regs(fe); | 730 | ret = tda18271_init_regs(fe); |
728 | 731 | fail: | |
729 | return 0; | 732 | return ret; |
730 | } | 733 | } |
731 | 734 | ||
732 | static int tda18271_init(struct dvb_frontend *fe) | 735 | static int tda18271_init(struct dvb_frontend *fe) |
733 | { | 736 | { |
734 | struct tda18271_priv *priv = fe->tuner_priv; | 737 | struct tda18271_priv *priv = fe->tuner_priv; |
738 | int ret; | ||
735 | 739 | ||
736 | mutex_lock(&priv->lock); | 740 | mutex_lock(&priv->lock); |
737 | 741 | ||
738 | /* power up */ | 742 | /* power up */ |
739 | tda18271_set_standby_mode(fe, 0, 0, 0); | 743 | ret = tda18271_set_standby_mode(fe, 0, 0, 0); |
744 | if (ret < 0) | ||
745 | goto fail; | ||
740 | 746 | ||
741 | /* initialization */ | 747 | /* initialization */ |
742 | tda18271_ir_cal_init(fe); | 748 | ret = tda18271_ir_cal_init(fe); |
749 | if (ret < 0) | ||
750 | goto fail; | ||
743 | 751 | ||
744 | if (priv->id == TDA18271HDC2) | 752 | if (priv->id == TDA18271HDC2) |
745 | tda18271c2_rf_cal_init(fe); | 753 | tda18271c2_rf_cal_init(fe); |
746 | 754 | fail: | |
747 | mutex_unlock(&priv->lock); | 755 | mutex_unlock(&priv->lock); |
748 | 756 | ||
749 | return 0; | 757 | return ret; |
750 | } | 758 | } |
751 | 759 | ||
752 | static int tda18271_tune(struct dvb_frontend *fe, | 760 | static int tda18271_tune(struct dvb_frontend *fe, |
753 | struct tda18271_std_map_item *map, u32 freq, u32 bw) | 761 | struct tda18271_std_map_item *map, u32 freq, u32 bw) |
754 | { | 762 | { |
755 | struct tda18271_priv *priv = fe->tuner_priv; | 763 | struct tda18271_priv *priv = fe->tuner_priv; |
764 | int ret; | ||
756 | 765 | ||
757 | tda_dbg("freq = %d, ifc = %d, bw = %d, agc_mode = %d, std = %d\n", | 766 | tda_dbg("freq = %d, ifc = %d, bw = %d, agc_mode = %d, std = %d\n", |
758 | freq, map->if_freq, bw, map->agc_mode, map->std); | 767 | freq, map->if_freq, bw, map->agc_mode, map->std); |
759 | 768 | ||
760 | tda18271_init(fe); | 769 | ret = tda18271_init(fe); |
770 | if (ret < 0) | ||
771 | goto fail; | ||
761 | 772 | ||
762 | mutex_lock(&priv->lock); | 773 | mutex_lock(&priv->lock); |
763 | 774 | ||
@@ -772,8 +783,8 @@ static int tda18271_tune(struct dvb_frontend *fe, | |||
772 | tda18271_channel_configuration(fe, map, freq, bw); | 783 | tda18271_channel_configuration(fe, map, freq, bw); |
773 | 784 | ||
774 | mutex_unlock(&priv->lock); | 785 | mutex_unlock(&priv->lock); |
775 | 786 | fail: | |
776 | return 0; | 787 | return ret; |
777 | } | 788 | } |
778 | 789 | ||
779 | /* ------------------------------------------------------------------ */ | 790 | /* ------------------------------------------------------------------ */ |
@@ -905,16 +916,17 @@ fail: | |||
905 | static int tda18271_sleep(struct dvb_frontend *fe) | 916 | static int tda18271_sleep(struct dvb_frontend *fe) |
906 | { | 917 | { |
907 | struct tda18271_priv *priv = fe->tuner_priv; | 918 | struct tda18271_priv *priv = fe->tuner_priv; |
919 | int ret; | ||
908 | 920 | ||
909 | mutex_lock(&priv->lock); | 921 | mutex_lock(&priv->lock); |
910 | 922 | ||
911 | /* standby mode w/ slave tuner output | 923 | /* standby mode w/ slave tuner output |
912 | * & loop thru & xtal oscillator on */ | 924 | * & loop thru & xtal oscillator on */ |
913 | tda18271_set_standby_mode(fe, 1, 0, 0); | 925 | ret = tda18271_set_standby_mode(fe, 1, 0, 0); |
914 | 926 | ||
915 | mutex_unlock(&priv->lock); | 927 | mutex_unlock(&priv->lock); |
916 | 928 | ||
917 | return 0; | 929 | return ret; |
918 | } | 930 | } |
919 | 931 | ||
920 | static int tda18271_release(struct dvb_frontend *fe) | 932 | static int tda18271_release(struct dvb_frontend *fe) |