aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarron Broad <darron@kewl.org>2008-10-15 12:43:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:28:31 -0400
commit7bdf84fc47f2d2ed2194b6ade480d043207c4098 (patch)
tree8f015d667fcba57e7223458c61c1de87f8d67413
parent6594690b39f9f9fcadafb1caf019bfd7a326e2e5 (diff)
V4L/DVB (9265): videobuf: data storage optimisation
To optimise data storage redundant vars are removed. Signed-off-by: Darron Broad <darron@kewl.org> Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c2
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/videobuf-dvb.c11
-rw-r--r--include/media/videobuf-dvb.h5
5 files changed, 10 insertions, 12 deletions
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index 110e2ed2061d..8f6fb2add7de 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -643,7 +643,7 @@ static int cx23885_init_tsport(struct cx23885_dev *dev,
643 init_timer(&port->mpegq.timeout); 643 init_timer(&port->mpegq.timeout);
644 644
645 mutex_init(&port->frontends.lock); 645 mutex_init(&port->frontends.lock);
646 INIT_LIST_HEAD(&port->frontends.frontend.felist); 646 INIT_LIST_HEAD(&port->frontends.felist);
647 port->frontends.active_fe_id = 0; 647 port->frontends.active_fe_id = 0;
648 648
649 /* This should be hardcoded allow a single frontend 649 /* This should be hardcoded allow a single frontend
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 1d8c8dd3006a..512041451d38 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -802,7 +802,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
802 list_add_tail(&dev->devlist,&cx8802_devlist); 802 list_add_tail(&dev->devlist,&cx8802_devlist);
803 803
804 mutex_init(&dev->frontends.lock); 804 mutex_init(&dev->frontends.lock);
805 INIT_LIST_HEAD(&dev->frontends.frontend.felist); 805 INIT_LIST_HEAD(&dev->frontends.felist);
806 806
807 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends); 807 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends);
808 808
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index d2d238912fbf..7d95a6928772 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -953,7 +953,7 @@ static int dvb_init(struct saa7134_dev *dev)
953 953
954 /* FIXME: add support for multi-frontend */ 954 /* FIXME: add support for multi-frontend */
955 mutex_init(&dev->frontends.lock); 955 mutex_init(&dev->frontends.lock);
956 INIT_LIST_HEAD(&dev->frontends.frontend.felist); 956 INIT_LIST_HEAD(&dev->frontends.felist);
957 dev->frontends.active_fe_id = 0; 957 dev->frontends.active_fe_id = 0;
958 958
959 printk(KERN_INFO "%s() allocating 1 frontend\n", __func__); 959 printk(KERN_INFO "%s() allocating 1 frontend\n", __func__);
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c
index af0b75cda6fd..fc4cfaa7bf5f 100644
--- a/drivers/media/video/videobuf-dvb.c
+++ b/drivers/media/video/videobuf-dvb.c
@@ -162,9 +162,8 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
162 162
163 /* Attach all of the frontends to the adapter */ 163 /* Attach all of the frontends to the adapter */
164 mutex_lock(&f->lock); 164 mutex_lock(&f->lock);
165 list_for_each_safe(list, q, &f->frontend.felist) { 165 list_for_each_safe(list, q, &f->felist) {
166 fe = list_entry(list, struct videobuf_dvb_frontend, felist); 166 fe = list_entry(list, struct videobuf_dvb_frontend, felist);
167
168 res = videobuf_dvb_register_frontend(&f->adapter, &fe->dvb); 167 res = videobuf_dvb_register_frontend(&f->adapter, &fe->dvb);
169 if (res < 0) { 168 if (res < 0) {
170 printk(KERN_WARNING "%s: videobuf_dvb_register_frontend failed (errno = %d)\n", 169 printk(KERN_WARNING "%s: videobuf_dvb_register_frontend failed (errno = %d)\n",
@@ -290,7 +289,7 @@ void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f)
290 struct videobuf_dvb_frontend *fe; 289 struct videobuf_dvb_frontend *fe;
291 290
292 mutex_lock(&f->lock); 291 mutex_lock(&f->lock);
293 list_for_each_safe(list, q, &f->frontend.felist) { 292 list_for_each_safe(list, q, &f->felist) {
294 fe = list_entry(list, struct videobuf_dvb_frontend, felist); 293 fe = list_entry(list, struct videobuf_dvb_frontend, felist);
295 294
296 dvb_net_release(&fe->dvb.net); 295 dvb_net_release(&fe->dvb.net);
@@ -316,7 +315,7 @@ struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_fro
316 315
317 mutex_lock(&f->lock); 316 mutex_lock(&f->lock);
318 317
319 list_for_each_safe(list, q, &f->frontend.felist) { 318 list_for_each_safe(list, q, &f->felist) {
320 fe = list_entry(list, struct videobuf_dvb_frontend, felist); 319 fe = list_entry(list, struct videobuf_dvb_frontend, felist);
321 if (fe->id == id) { 320 if (fe->id == id) {
322 ret = fe; 321 ret = fe;
@@ -337,7 +336,7 @@ int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_fron
337 336
338 mutex_lock(&f->lock); 337 mutex_lock(&f->lock);
339 338
340 list_for_each_safe(list, q, &f->frontend.felist) { 339 list_for_each_safe(list, q, &f->felist) {
341 fe = list_entry(list, struct videobuf_dvb_frontend, felist); 340 fe = list_entry(list, struct videobuf_dvb_frontend, felist);
342 if (fe->dvb.frontend == p) { 341 if (fe->dvb.frontend == p) {
343 ret = fe->id; 342 ret = fe->id;
@@ -363,7 +362,7 @@ struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(void *private, struct
363 mutex_init(&fe->dvb.lock); 362 mutex_init(&fe->dvb.lock);
364 363
365 mutex_lock(&f->lock); 364 mutex_lock(&f->lock);
366 list_add_tail(&fe->felist,&f->frontend.felist); 365 list_add_tail(&fe->felist,&f->felist);
367 mutex_unlock(&f->lock); 366 mutex_unlock(&f->lock);
368 367
369fail_alloc: 368fail_alloc:
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h
index 1a401f7320b9..069215c77a65 100644
--- a/include/media/videobuf-dvb.h
+++ b/include/media/videobuf-dvb.h
@@ -16,7 +16,6 @@ struct videobuf_dvb {
16 int nfeeds; 16 int nfeeds;
17 17
18 /* videobuf_dvb_(un)register manges this */ 18 /* videobuf_dvb_(un)register manges this */
19 struct dvb_adapter adapter;
20 struct dvb_demux demux; 19 struct dvb_demux demux;
21 struct dmxdev dmxdev; 20 struct dmxdev dmxdev;
22 struct dmx_frontend fe_hw; 21 struct dmx_frontend fe_hw;
@@ -25,17 +24,17 @@ struct videobuf_dvb {
25}; 24};
26 25
27struct videobuf_dvb_frontend { 26struct videobuf_dvb_frontend {
28 void *dev;
29 struct list_head felist; 27 struct list_head felist;
28 void *dev;
30 int id; 29 int id;
31 struct videobuf_dvb dvb; 30 struct videobuf_dvb dvb;
32}; 31};
33 32
34struct videobuf_dvb_frontends { 33struct videobuf_dvb_frontends {
34 struct list_head felist;
35 struct mutex lock; 35 struct mutex lock;
36 struct dvb_adapter adapter; 36 struct dvb_adapter adapter;
37 int active_fe_id; /* Indicates which frontend in the felist is in use */ 37 int active_fe_id; /* Indicates which frontend in the felist is in use */
38 struct videobuf_dvb_frontend frontend;
39 int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */ 38 int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
40}; 39};
41 40