Hi Mauro, On Fri, Aug 07, 2015 at 11:19:59AM -0300, Mauro Carvalho Chehab wrote: > We'll need unique IDs for graph objects and a way to associate > them with the media interface. > > So, add an atomic var to be used to create unique IDs and > a list to store such objects. > > Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx> > > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c > index 7b39440192d6..e627b0b905ad 100644 > --- a/drivers/media/media-device.c > +++ b/drivers/media/media-device.c > @@ -396,6 +396,10 @@ int __must_check __media_device_register(struct media_device *mdev, > return ret; > } > > + /* Initialize media graph object list and ID */ > + atomic_set(&mdev->last_obj_id, 0); > + INIT_LIST_HEAD(&mdev->object_list); > + > return 0; > } > EXPORT_SYMBOL_GPL(__media_device_register); > diff --git a/include/media/media-device.h b/include/media/media-device.h > index 6e6db78f1ee2..a9d546716e49 100644 > --- a/include/media/media-device.h > +++ b/include/media/media-device.h > @@ -78,6 +78,10 @@ struct media_device { > > int (*link_notify)(struct media_link *link, u32 flags, > unsigned int notification); > + > + /* Used by media_graph stuff */ > + atomic_t last_obj_id; > + struct list_head object_list; > }; > > /* Supported link_notify @notification values. */ Instead of starting with rework of the MC internals, what would you think of separating interfaces from entities first, and see how that would be used by a driver (e.g. DVB)? I think a simple linked list would do per entity, no links would be needed at this point in the internal representation. I'll review this better during the next week. -- Kind regards, Sakari Ailus e-mail: sakari.ailus@xxxxxx XMPP: sailus@xxxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html