Commit 480884b6 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent a3dfc6d9
......@@ -1185,7 +1185,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
if (smsdvb_debugfs_create(client) < 0)
pr_info("failed to create debugfs node\n");
dvb_create_media_graph(coredev->media_dev);
dvb_create_media_graph(&client->adapter);
pr_info("DVB interface registered.\n");
return 0;
......
......@@ -381,9 +381,10 @@ void dvb_unregister_device(struct dvb_device *dvbdev)
EXPORT_SYMBOL(dvb_unregister_device);
void dvb_create_media_graph(struct media_device *mdev)
{
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
void dvb_create_media_graph(struct dvb_adapter *adap)
{
struct media_device *mdev = adap->mdev;
struct media_entity *entity, *tuner = NULL, *fe = NULL;
struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL;
......@@ -421,9 +422,9 @@ void dvb_create_media_graph(struct media_device *mdev)
if (demux && ca)
media_entity_create_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
#endif
}
EXPORT_SYMBOL_GPL(dvb_create_media_graph);
#endif
static int dvbdev_check_free_adapter_num(int num)
{
......
......@@ -122,7 +122,12 @@ extern int dvb_register_device (struct dvb_adapter *adap,
int type);
extern void dvb_unregister_device (struct dvb_device *dvbdev);
void dvb_create_media_graph(struct media_device *mdev);
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
void dvb_create_media_graph(struct dvb_adapter *adap);
#else
static inline void dvb_create_media_graph(struct dvb_adapter *adap) {}
#endif
extern int dvb_generic_open (struct inode *inode, struct file *file);
extern int dvb_generic_release (struct inode *inode, struct file *file);
......
......@@ -540,9 +540,8 @@ static int register_dvb(struct cx231xx_dvb *dvb,
/* register network adapter */
dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
dvb_create_media_graph(dev->media_dev);
#endif
dvb_create_media_graph(&dvb->adapter);
return 0;
fail_fe_conn:
......
......@@ -702,7 +702,7 @@ static int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap)
}
}
dvb_create_media_graph(adap->dvb_adap.mdev);
dvb_create_media_graph(&adap->dvb_adap);
return 0;
......
......@@ -320,7 +320,7 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
adap->num_frontends_initialized++;
}
dvb_create_media_graph(adap->dvb_adap.mdev);
dvb_create_media_graph(&adap->dvb_adap);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment