]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
[media] tuner-core: Don't use a static var for xc5000_cfg
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 4 Feb 2011 15:56:39 +0000 (12:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:32:02 +0000 (20:32 -0300)
A static var is evil, especially if a device has two boards with
xc5000. Instead, just like the other drivers, use stack to store
its config during setup.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/tuner-core.c

index 70ff416c0ced9a71a66a009ad283ffa22a5bec48..16939cad987cde2c2bb1d98552f7946bfee3a959 100644 (file)
@@ -66,7 +66,6 @@ module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
  * Static vars
  */
 
-static struct xc5000_config xc5000_cfg;
 static LIST_HEAD(tuner_list);
 
 /*
@@ -338,9 +337,12 @@ static void set_type(struct i2c_client *c, unsigned int type,
                break;
        case TUNER_XC5000:
        {
-               xc5000_cfg.i2c_address    = t->i2c->addr;
-               /* if_khz will be set when the digital dvb_attach() occurs */
-               xc5000_cfg.if_khz         = 0;
+               struct xc5000_config xc5000_cfg = {
+                       .i2c_address = t->i2c->addr,
+                       /* if_khz will be set at dvb_attach() */
+                       .if_khz   = 0,
+               };
+
                if (!dvb_attach(xc5000_attach,
                                &t->fe, t->i2c->adapter, &xc5000_cfg))
                        goto attach_failed;