[media] DVB: dvb_frontend: fix stale parameters on initial frontend event
authorAndreas Oberritter <obi@linuxtv.org>
Thu, 4 Aug 2011 15:33:12 +0000 (12:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 3 Sep 2011 11:46:59 +0000 (08:46 -0300)
  Modify it to use the data given by the user.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-core/dvb_frontend.c

index efe9c30..23d79d0 100644 (file)
@@ -1827,6 +1827,13 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
                        dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
                }
 
+               /*
+                * Initialize output parameters to match the values given by
+                * the user. FE_SET_FRONTEND triggers an initial frontend event
+                * with status = 0, which copies output parameters to userspace.
+                */
+               fepriv->parameters_out = fepriv->parameters_in;
+
                memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
                memcpy(&fetunesettings.parameters, parg,
                       sizeof (struct dvb_frontend_parameters));