aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-25 08:55:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-25 14:10:42 -0400
commit6f8ca0b541c8bb542edb02dad68bd723625132e7 (patch)
tree4c57b5ab07d79da0355bf4d35d205f38d8557ad7
parent383730c36419b85233fe2b5081253a2181160d17 (diff)
[media] tuner-core: Remove the now uneeded checks at fe_has_signal/get_afc
Now that those functions are only used when the corresponding function calls are defined, we don't need to check if those function calls are present at the structure before using it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/v4l2-core/tuner-core.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index 5e18f4401801..f1e8b402b7ca 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -222,8 +222,7 @@ static int fe_has_signal(struct dvb_frontend *fe)
222{ 222{
223 u16 strength = 0; 223 u16 strength = 0;
224 224
225 if (fe->ops.tuner_ops.get_rf_strength) 225 fe->ops.tuner_ops.get_rf_strength(fe, &strength);
226 fe->ops.tuner_ops.get_rf_strength(fe, &strength);
227 226
228 return strength; 227 return strength;
229} 228}
@@ -232,8 +231,7 @@ static int fe_get_afc(struct dvb_frontend *fe)
232{ 231{
233 s32 afc = 0; 232 s32 afc = 0;
234 233
235 if (fe->ops.tuner_ops.get_afc) 234 fe->ops.tuner_ops.get_afc(fe, &afc);
236 fe->ops.tuner_ops.get_afc(fe, &afc);
237 235
238 return afc; 236 return afc;
239} 237}
@@ -256,8 +254,6 @@ static void tuner_status(struct dvb_frontend *fe);
256static const struct analog_demod_ops tuner_analog_ops = { 254static const struct analog_demod_ops tuner_analog_ops = {
257 .set_params = fe_set_params, 255 .set_params = fe_set_params,
258 .standby = fe_standby, 256 .standby = fe_standby,
259 .has_signal = fe_has_signal,
260 .get_afc = fe_get_afc,
261 .set_config = fe_set_config, 257 .set_config = fe_set_config,
262 .tuner_status = tuner_status 258 .tuner_status = tuner_status
263}; 259};
@@ -453,10 +449,10 @@ static void set_type(struct i2c_client *c, unsigned int type,
453 memcpy(analog_ops, &tuner_analog_ops, 449 memcpy(analog_ops, &tuner_analog_ops,
454 sizeof(struct analog_demod_ops)); 450 sizeof(struct analog_demod_ops));
455 451
456 if (fe_tuner_ops->get_rf_strength == NULL) 452 if (fe_tuner_ops->get_rf_strength)
457 analog_ops->has_signal = NULL; 453 analog_ops->has_signal = fe_has_signal;
458 if (fe_tuner_ops->get_afc == NULL) 454 if (fe_tuner_ops->get_afc)
459 analog_ops->get_afc = NULL; 455 analog_ops->get_afc = fe_get_afc;
460 456
461 } else { 457 } else {
462 t->name = analog_ops->info.name; 458 t->name = analog_ops->info.name;