Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115670
b: refs/heads/master
c: dcadd08
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Oct 17, 2008
1 parent e1849ae commit 7bd6e7e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 69 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: 64decbfe0dca9535a6f9b0c6fa654e3c2eb47877
refs/heads/master: dcadd0826fce17e77cd6260569cbb3dd681c868c
108 changes: 50 additions & 58 deletions trunk/drivers/media/video/videobuf-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,55 +133,7 @@ static int videobuf_dvb_stop_feed(struct dvb_demux_feed *feed)
return err;
}

/* ------------------------------------------------------------------ */
/* Register a single adapter and one or more frontends */
int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
struct module *module,
void *adapter_priv,
struct device *device,
short *adapter_nr,
int mfe_shared)
{
struct list_head *list, *q;
struct videobuf_dvb_frontend *fe;
int res;

fe = videobuf_dvb_get_frontend(f, 1);
if (!fe) {
printk(KERN_WARNING "Unable to register the adapter which has no frontends\n");
return -EINVAL;
}

/* Bring up the adapter */
res = videobuf_dvb_register_adapter(f, module, adapter_priv, device,
fe->dvb.name, adapter_nr, mfe_shared);
if (res < 0) {
printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res);
return res;
}

/* Attach all of the frontends to the adapter */
mutex_lock(&f->lock);
list_for_each_safe(list, q, &f->felist) {
fe = list_entry(list, struct videobuf_dvb_frontend, felist);
res = videobuf_dvb_register_frontend(&f->adapter, &fe->dvb);
if (res < 0) {
printk(KERN_WARNING "%s: videobuf_dvb_register_frontend failed (errno = %d)\n",
fe->dvb.name, res);
goto err;
}
}
mutex_unlock(&f->lock);
return 0;

err:
mutex_unlock(&f->lock);
videobuf_dvb_unregister_bus(f);
return res;
}
EXPORT_SYMBOL(videobuf_dvb_register_bus);

int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
static int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
struct module *module,
void *adapter_priv,
struct device *device,
Expand All @@ -206,7 +158,7 @@ int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
return result;
}

int videobuf_dvb_register_frontend(struct dvb_adapter *adapter,
static int videobuf_dvb_register_frontend(struct dvb_adapter *adapter,
struct videobuf_dvb *dvb)
{
int result;
Expand Down Expand Up @@ -294,6 +246,54 @@ int videobuf_dvb_register_frontend(struct dvb_adapter *adapter,
return result;
}

/* ------------------------------------------------------------------ */
/* Register a single adapter and one or more frontends */
int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
struct module *module,
void *adapter_priv,
struct device *device,
short *adapter_nr,
int mfe_shared)
{
struct list_head *list, *q;
struct videobuf_dvb_frontend *fe;
int res;

fe = videobuf_dvb_get_frontend(f, 1);
if (!fe) {
printk(KERN_WARNING "Unable to register the adapter which has no frontends\n");
return -EINVAL;
}

/* Bring up the adapter */
res = videobuf_dvb_register_adapter(f, module, adapter_priv, device,
fe->dvb.name, adapter_nr, mfe_shared);
if (res < 0) {
printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res);
return res;
}

/* Attach all of the frontends to the adapter */
mutex_lock(&f->lock);
list_for_each_safe(list, q, &f->felist) {
fe = list_entry(list, struct videobuf_dvb_frontend, felist);
res = videobuf_dvb_register_frontend(&f->adapter, &fe->dvb);
if (res < 0) {
printk(KERN_WARNING "%s: videobuf_dvb_register_frontend failed (errno = %d)\n",
fe->dvb.name, res);
goto err;
}
}
mutex_unlock(&f->lock);
return 0;

err:
mutex_unlock(&f->lock);
videobuf_dvb_unregister_bus(f);
return res;
}
EXPORT_SYMBOL(videobuf_dvb_register_bus);

void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f)
{
struct list_head *list, *q;
Expand Down Expand Up @@ -389,11 +389,3 @@ struct videobuf_dvb_frontend *videobuf_dvb_alloc_frontend(
return fe;
}
EXPORT_SYMBOL(videobuf_dvb_alloc_frontend);

/* ------------------------------------------------------------------ */
/*
* Local variables:
* c-basic-offset: 8
* compile-command: "make DVB=1"
* End:
*/
10 changes: 0 additions & 10 deletions trunk/include/media/videobuf-dvb.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,

void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);

int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *f,
struct module *module,
void *adapter_priv,
struct device *device,
char *adapter_name,
short *adapter_nr,
int mfe_shared);

int videobuf_dvb_register_frontend(struct dvb_adapter *adapter, struct videobuf_dvb *dvb);

struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id);

struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id);
Expand Down

0 comments on commit 7bd6e7e

Please sign in to comment.