return -EINVAL;
INIT_LIST_HEAD(&mdev->entities);
+ INIT_LIST_HEAD(&mdev->interfaces);
spin_lock_init(&mdev->lock);
mutex_init(&mdev->graph_mutex);
INIT_LIST_HEAD(&intf->links);
media_gobj_init(mdev, gobj_type, &intf->graph_obj);
+
+ list_add_tail(&intf->list, &mdev->interfaces);
}
/* Functions related to the media interface via device nodes */
void media_devnode_remove(struct media_intf_devnode *devnode)
{
media_gobj_remove(&devnode->intf.graph_obj);
+ list_del(&devnode->intf.list);
kfree(devnode);
}
EXPORT_SYMBOL_GPL(media_devnode_remove);
* @link_id: Unique ID used on the last link registered
* @intf_devnode_id: Unique ID used on the last interface devnode registered
* @entities: List of registered entities
+ * @interfaces: List of registered interfaces
* @lock: Entities list lock
* @graph_mutex: Entities graph operation lock
* @link_notify: Link state change notification callback
u32 intf_devnode_id;
struct list_head entities;
+ struct list_head interfaces;
/* Protects the entities list */
spinlock_t lock;
* struct media_intf_devnode - Define a Kernel API interface
*
* @graph_obj: embedded graph object
+ * @list: Linked list used to find other interfaces that belong
+ * to the same media controller
* @links: List of links pointing to graph entities
* @type: Type of the interface as defined at the
* uapi/media/media.h header, e. g.
*/
struct media_interface {
struct media_gobj graph_obj;
+ struct list_head list;
struct list_head links;
u32 type;
u32 flags;