diff options
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r-- | drivers/media/video/tuner-simple.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index d6d922c32bce..3ec76391a60d 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c | |||
@@ -149,7 +149,12 @@ static inline int tuner_afcstatus(const int status) | |||
149 | static int simple_get_status(struct dvb_frontend *fe, u32 *status) | 149 | static int simple_get_status(struct dvb_frontend *fe, u32 *status) |
150 | { | 150 | { |
151 | struct tuner_simple_priv *priv = fe->tuner_priv; | 151 | struct tuner_simple_priv *priv = fe->tuner_priv; |
152 | int tuner_status = tuner_read_status(fe); | 152 | int tuner_status; |
153 | |||
154 | if (priv->i2c_props.adap == NULL) | ||
155 | return -EINVAL; | ||
156 | |||
157 | tuner_status = tuner_read_status(fe); | ||
153 | 158 | ||
154 | *status = 0; | 159 | *status = 0; |
155 | 160 | ||
@@ -166,7 +171,12 @@ static int simple_get_status(struct dvb_frontend *fe, u32 *status) | |||
166 | static int simple_get_rf_strength(struct dvb_frontend *fe, u16 *strength) | 171 | static int simple_get_rf_strength(struct dvb_frontend *fe, u16 *strength) |
167 | { | 172 | { |
168 | struct tuner_simple_priv *priv = fe->tuner_priv; | 173 | struct tuner_simple_priv *priv = fe->tuner_priv; |
169 | int signal = tuner_signal(tuner_read_status(fe)); | 174 | int signal; |
175 | |||
176 | if (priv->i2c_props.adap == NULL) | ||
177 | return -EINVAL; | ||
178 | |||
179 | signal = tuner_signal(tuner_read_status(fe)); | ||
170 | 180 | ||
171 | *strength = signal; | 181 | *strength = signal; |
172 | 182 | ||
@@ -685,6 +695,9 @@ static int simple_set_params(struct dvb_frontend *fe, | |||
685 | struct tuner_simple_priv *priv = fe->tuner_priv; | 695 | struct tuner_simple_priv *priv = fe->tuner_priv; |
686 | int ret = -EINVAL; | 696 | int ret = -EINVAL; |
687 | 697 | ||
698 | if (priv->i2c_props.adap == NULL) | ||
699 | return -EINVAL; | ||
700 | |||
688 | switch (params->mode) { | 701 | switch (params->mode) { |
689 | case V4L2_TUNER_RADIO: | 702 | case V4L2_TUNER_RADIO: |
690 | ret = simple_set_radio_freq(fe, params); | 703 | ret = simple_set_radio_freq(fe, params); |