提交 cf975a4b 编写于 作者: M Mauro Carvalho Chehab

[media] media: Use a macro to interate between all interfaces

Just like we do with entities, use a similar macro for the
interfaces loop.
Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 c398bb64
......@@ -578,9 +578,10 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
}
/* Create indirect interface links for FE->tuner, DVR->demux and CA->ca */
list_for_each_entry(intf, &mdev->interfaces, list) {
media_device_for_each_intf(intf, mdev) {
if (intf->type == MEDIA_INTF_T_DVB_CA && ca)
media_create_intf_link(ca, intf, 0);
if (intf->type == MEDIA_INTF_T_DVB_FE && tuner)
media_create_intf_link(tuner, intf, 0);
......
......@@ -113,6 +113,11 @@ struct media_device *media_device_find_devres(struct device *dev);
#define media_device_for_each_entity(entity, mdev) \
list_for_each_entry(entity, &(mdev)->entities, list)
/* Iterate over all interfaces. */
#define media_device_for_each_intf(intf, mdev) \
list_for_each_entry(intf, &(mdev)->interfaces, list)
#else
static inline int media_device_register(struct media_device *mdev)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册