V4L/DVB (4211): Fix an Oops for all fe that have get_frontend_algo == NULL
authorManu Abraham <abraham.manu@gmail.com>
Sat, 24 Jun 2006 14:18:58 +0000 (11:18 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 26 Jun 2006 12:20:49 +0000 (09:20 -0300)
Thanks to Johannes Stezenbach for pointing it out

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-core/dvb_frontend.c

index 3152a54..9be41e4 100644 (file)
@@ -556,21 +556,23 @@ static int dvb_frontend_thread(void *data)
                }
 
                /* do an iteration of the tuning loop */
-               if (fe->ops.get_frontend_algo(fe) == FE_ALGO_HW) {
-                       /* have we been asked to retune? */
-                       params = NULL;
-                       if (fepriv->state & FESTATE_RETUNE) {
-                               params = &fepriv->parameters;
-                               fepriv->state = FESTATE_TUNED;
-                       }
+               if (fe->ops.get_frontend_algo) {
+                       if (fe->ops.get_frontend_algo(fe) == FE_ALGO_HW) {
+                               /* have we been asked to retune? */
+                               params = NULL;
+                               if (fepriv->state & FESTATE_RETUNE) {
+                                       params = &fepriv->parameters;
+                                       fepriv->state = FESTATE_TUNED;
+                               }
 
-                       fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s);
-                       if (s != fepriv->status) {
-                               dvb_frontend_add_event(fe, s);
-                               fepriv->status = s;
+                               fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s);
+                               if (s != fepriv->status) {
+                                       dvb_frontend_add_event(fe, s);
+                                       fepriv->status = s;
+                               }
+                       } else {
+                               dvb_frontend_swzigzag(fe);
                        }
-               } else {
-                       dvb_frontend_swzigzag(fe);
                }
        }