Re: [RFC/PATCH v4 03/11] media: Entities, pads and links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mauro,

On Thursday 09 September 2010 02:41:54 Mauro Carvalho Chehab wrote:
> Em 20-08-2010 12:29, Laurent Pinchart escreveu:

[snip]

> > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> > index 781c641..eeb002e 100644
> > --- a/drivers/media/media-device.c
> > +++ b/drivers/media/media-device.c

[snip]

> > +/**
> > + * media_device_register_entity - Register an entity with a media device
> > + * @mdev:	The media device
> > + * @entity:	The entity
> > + */
> > +int __must_check media_device_register_entity(struct media_device *mdev,
> > +					      struct media_entity *entity)
> > +{
> > +	/* Warn if we apparently re-register an entity */
> > +	WARN_ON(entity->parent != NULL);
> 
> Instead, it should just return -EINVAL and use __must_check.
> 
> What's the sense of allowing registering it twice?

It's a driver bug. Entities must not be registered twice. The WARN_ON is meant 
as a way to catch driver bugs. I can replace it with a BUG_ON.

[snip]

> > +EXPORT_SYMBOL(media_entity_init);
> 
> Just use EXPORT_SYMBOL_GPL() for all symbols that needs to be exported.

OK.

-- 
Regards,

Laurent Pinchart
--
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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux