diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-02-04 10:56:39 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:02 -0400 |
commit | 900f734b3bafb4e111b9ec5d865c448a9911b2ab (patch) | |
tree | bd2dbb7c257596f132dcd8cd78c117d540cc1c43 /drivers/media/video | |
parent | 7d275bf840a8f390b8fd3d686545e09ef01f7915 (diff) |
[media] tuner-core: Don't use a static var for xc5000_cfg
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>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/tuner-core.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 70ff416c0ced..16939cad987c 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -66,7 +66,6 @@ module_param_string(ntsc, ntsc, sizeof(ntsc), 0644); | |||
66 | * Static vars | 66 | * Static vars |
67 | */ | 67 | */ |
68 | 68 | ||
69 | static struct xc5000_config xc5000_cfg; | ||
70 | static LIST_HEAD(tuner_list); | 69 | static LIST_HEAD(tuner_list); |
71 | 70 | ||
72 | /* | 71 | /* |
@@ -338,9 +337,12 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
338 | break; | 337 | break; |
339 | case TUNER_XC5000: | 338 | case TUNER_XC5000: |
340 | { | 339 | { |
341 | xc5000_cfg.i2c_address = t->i2c->addr; | 340 | struct xc5000_config xc5000_cfg = { |
342 | /* if_khz will be set when the digital dvb_attach() occurs */ | 341 | .i2c_address = t->i2c->addr, |
343 | xc5000_cfg.if_khz = 0; | 342 | /* if_khz will be set at dvb_attach() */ |
343 | .if_khz = 0, | ||
344 | }; | ||
345 | |||
344 | if (!dvb_attach(xc5000_attach, | 346 | if (!dvb_attach(xc5000_attach, |
345 | &t->fe, t->i2c->adapter, &xc5000_cfg)) | 347 | &t->fe, t->i2c->adapter, &xc5000_cfg)) |
346 | goto attach_failed; | 348 | goto attach_failed; |