]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
[media] media: Use a macro to interate between all interfaces
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 23 Aug 2015 10:51:22 +0000 (07:51 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:18:53 +0000 (12:18 -0200)
Just like we do with entities, use a similar macro for the
interfaces loop.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvbdev.c
include/media/media-device.h

index 6babc688801bbe82de55c9968690a4d8c1eb8c96..f00f1a5f279cfa524f45375b139d4862588d9751 100644 (file)
@@ -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);
 
index 51807efa505b5b988d01bd69ed3e0f1e2aa646e6..f23d686aaac60bf9d904e81c4954b0a8ffea1bb5 100644 (file)
@@ -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)
 {