Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76445
b: refs/heads/master
c: aa501be
h: refs/heads/master
i:
  76443: db15f70
v: v3
  • Loading branch information
Chris Pascoe authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent 7172388 commit edb6bff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91240dd92474d4124f80b00e6200052b275a99a1
refs/heads/master: aa501be989f5df58c4732d5eb1989e5ca6479d90
14 changes: 13 additions & 1 deletion trunk/drivers/media/video/tuner-xc2028.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ MODULE_PARM_DESC(audio_std,
"NICAM/B\n");

static LIST_HEAD(xc2028_list);
static DEFINE_MUTEX(xc2028_list_mutex);

/* struct for storing firmware table */
struct firmware_description {
unsigned int type;
Expand Down Expand Up @@ -854,6 +856,8 @@ static int xc2028_dvb_release(struct dvb_frontend *fe)

tuner_dbg("%s called\n", __FUNCTION__);

mutex_lock(&xc2028_list_mutex);

priv->count--;

if (!priv->count) {
Expand All @@ -865,6 +869,8 @@ static int xc2028_dvb_release(struct dvb_frontend *fe)
kfree(priv);
}

mutex_unlock(&xc2028_list_mutex);

return 0;
}

Expand Down Expand Up @@ -940,6 +946,8 @@ void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg)

video_dev = cfg->video_dev;

mutex_lock(&xc2028_list_mutex);

list_for_each_entry(priv, &xc2028_list, xc2028_list) {
if (priv->video_dev == cfg->video_dev) {
video_dev = NULL;
Expand All @@ -949,8 +957,10 @@ void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg)

if (video_dev) {
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (priv == NULL)
if (priv == NULL) {
mutex_unlock(&xc2028_list_mutex);
return NULL;
}

priv->bandwidth = BANDWIDTH_6_MHZ;
priv->need_load_generic = 1;
Expand All @@ -974,6 +984,8 @@ void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg)

tuner_info("type set to %s\n", "XCeive xc2028/xc3028 tuner");

mutex_unlock(&xc2028_list_mutex);

return fe;
}

Expand Down

0 comments on commit edb6bff

Please sign in to comment.