diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-03-02 08:49:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-03-02 09:25:38 -0500 |
commit | 480884b647c7efecb904a9ed022ee533afb9cb80 (patch) | |
tree | d656556a59caefe3f07d349b7a9866a37e7fa5a5 | |
parent | a3dfc6d925ca1bbd1a228253acb93f08657bad25 (diff) |
[media] dvbdev: use adapter arg for dvb_create_media_graph()
Instead of using media_dev argument for dvb_create_media_graph(),
use the adapter.
That allows to create a stub for this function, if compiled
without DVB support, avoiding to add extra if's at the drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/common/siano/smsdvb-main.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb-core/dvbdev.c | 7 | ||||
-rw-r--r-- | drivers/media/dvb-core/dvbdev.h | 7 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-dvb.c | 5 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 2 |
6 files changed, 15 insertions, 10 deletions
diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index dd3c1516013f..387db145d37e 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c | |||
@@ -1185,7 +1185,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, | |||
1185 | if (smsdvb_debugfs_create(client) < 0) | 1185 | if (smsdvb_debugfs_create(client) < 0) |
1186 | pr_info("failed to create debugfs node\n"); | 1186 | pr_info("failed to create debugfs node\n"); |
1187 | 1187 | ||
1188 | dvb_create_media_graph(coredev->media_dev); | 1188 | dvb_create_media_graph(&client->adapter); |
1189 | 1189 | ||
1190 | pr_info("DVB interface registered.\n"); | 1190 | pr_info("DVB interface registered.\n"); |
1191 | return 0; | 1191 | return 0; |
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 0af9d0c5f889..13bb57f0457f 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c | |||
@@ -381,9 +381,10 @@ void dvb_unregister_device(struct dvb_device *dvbdev) | |||
381 | EXPORT_SYMBOL(dvb_unregister_device); | 381 | EXPORT_SYMBOL(dvb_unregister_device); |
382 | 382 | ||
383 | 383 | ||
384 | void dvb_create_media_graph(struct media_device *mdev) | ||
385 | { | ||
386 | #ifdef CONFIG_MEDIA_CONTROLLER_DVB | 384 | #ifdef CONFIG_MEDIA_CONTROLLER_DVB |
385 | void dvb_create_media_graph(struct dvb_adapter *adap) | ||
386 | { | ||
387 | struct media_device *mdev = adap->mdev; | ||
387 | struct media_entity *entity, *tuner = NULL, *fe = NULL; | 388 | struct media_entity *entity, *tuner = NULL, *fe = NULL; |
388 | struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL; | 389 | struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL; |
389 | 390 | ||
@@ -421,9 +422,9 @@ void dvb_create_media_graph(struct media_device *mdev) | |||
421 | 422 | ||
422 | if (demux && ca) | 423 | if (demux && ca) |
423 | media_entity_create_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED); | 424 | media_entity_create_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED); |
424 | #endif | ||
425 | } | 425 | } |
426 | EXPORT_SYMBOL_GPL(dvb_create_media_graph); | 426 | EXPORT_SYMBOL_GPL(dvb_create_media_graph); |
427 | #endif | ||
427 | 428 | ||
428 | static int dvbdev_check_free_adapter_num(int num) | 429 | static int dvbdev_check_free_adapter_num(int num) |
429 | { | 430 | { |
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h index 467c1311bd4c..556c9e9d1d4e 100644 --- a/drivers/media/dvb-core/dvbdev.h +++ b/drivers/media/dvb-core/dvbdev.h | |||
@@ -122,7 +122,12 @@ extern int dvb_register_device (struct dvb_adapter *adap, | |||
122 | int type); | 122 | int type); |
123 | 123 | ||
124 | extern void dvb_unregister_device (struct dvb_device *dvbdev); | 124 | extern void dvb_unregister_device (struct dvb_device *dvbdev); |
125 | void dvb_create_media_graph(struct media_device *mdev); | 125 | |
126 | #ifdef CONFIG_MEDIA_CONTROLLER_DVB | ||
127 | void dvb_create_media_graph(struct dvb_adapter *adap); | ||
128 | #else | ||
129 | static inline void dvb_create_media_graph(struct dvb_adapter *adap) {} | ||
130 | #endif | ||
126 | 131 | ||
127 | extern int dvb_generic_open (struct inode *inode, struct file *file); | 132 | extern int dvb_generic_open (struct inode *inode, struct file *file); |
128 | extern int dvb_generic_release (struct inode *inode, struct file *file); | 133 | extern int dvb_generic_release (struct inode *inode, struct file *file); |
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 44229a2c2d32..8bf2baae387f 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c | |||
@@ -540,9 +540,8 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
540 | 540 | ||
541 | /* register network adapter */ | 541 | /* register network adapter */ |
542 | dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx); | 542 | dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx); |
543 | #ifdef CONFIG_MEDIA_CONTROLLER_DVB | 543 | dvb_create_media_graph(&dvb->adapter); |
544 | dvb_create_media_graph(dev->media_dev); | 544 | |
545 | #endif | ||
546 | return 0; | 545 | return 0; |
547 | 546 | ||
548 | fail_fe_conn: | 547 | fail_fe_conn: |
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index 0666c8f33ac7..08a3cd1c8b44 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | |||
@@ -702,7 +702,7 @@ static int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap) | |||
702 | } | 702 | } |
703 | } | 703 | } |
704 | 704 | ||
705 | dvb_create_media_graph(adap->dvb_adap.mdev); | 705 | dvb_create_media_graph(&adap->dvb_adap); |
706 | 706 | ||
707 | return 0; | 707 | return 0; |
708 | 708 | ||
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index a7bc4535c58f..6c9f5ecf949c 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c | |||
@@ -320,7 +320,7 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap) | |||
320 | adap->num_frontends_initialized++; | 320 | adap->num_frontends_initialized++; |
321 | } | 321 | } |
322 | 322 | ||
323 | dvb_create_media_graph(adap->dvb_adap.mdev); | 323 | dvb_create_media_graph(&adap->dvb_adap); |
324 | 324 | ||
325 | return 0; | 325 | return 0; |
326 | } | 326 | } |