From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] v4l: Don't register media entities for subdev device nodes
Date: Tue, 12 Apr 2011 15:35:36 +0300 [thread overview]
Message-ID: <4DA44718.1090501@maxwell.research.nokia.com> (raw)
In-Reply-To: <1302531990-5395-1-git-send-email-laurent.pinchart@ideasonboard.com>
Laurent Pinchart wrote:
> Subdevs already have their own entity, don't register as second one when
> registering the subdev device node.
Thanks for the patch!
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/video/v4l2-dev.c | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
> index 498e674..6dc7196 100644
> --- a/drivers/media/video/v4l2-dev.c
> +++ b/drivers/media/video/v4l2-dev.c
> @@ -389,7 +389,8 @@ static int v4l2_open(struct inode *inode, struct file *filp)
> video_get(vdev);
> mutex_unlock(&videodev_lock);
> #if defined(CONFIG_MEDIA_CONTROLLER)
> - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) {
> + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
> + vdev->vfl_type != VFL_TYPE_SUBDEV) {
> entity = media_entity_get(&vdev->entity);
> if (!entity) {
> ret = -EBUSY;
> @@ -415,7 +416,8 @@ err:
> /* decrease the refcount in case of an error */
> if (ret) {
> #if defined(CONFIG_MEDIA_CONTROLLER)
> - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev)
> + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
> + vdev->vfl_type != VFL_TYPE_SUBDEV)
> media_entity_put(entity);
> #endif
> video_put(vdev);
> @@ -437,7 +439,8 @@ static int v4l2_release(struct inode *inode, struct file *filp)
> mutex_unlock(vdev->lock);
> }
> #if defined(CONFIG_MEDIA_CONTROLLER)
> - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev)
> + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
> + vdev->vfl_type != VFL_TYPE_SUBDEV)
> media_entity_put(&vdev->entity);
> #endif
> /* decrease the refcount unconditionally since the release()
> @@ -686,7 +689,8 @@ int __video_register_device(struct video_device *vdev, int type, int nr,
>
> #if defined(CONFIG_MEDIA_CONTROLLER)
> /* Part 5: Register the entity. */
> - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) {
> + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
> + vdev->vfl_type != VFL_TYPE_SUBDEV) {
> vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L;
> vdev->entity.name = vdev->name;
> vdev->entity.v4l.major = VIDEO_MAJOR;
> @@ -733,7 +737,8 @@ void video_unregister_device(struct video_device *vdev)
> return;
>
> #if defined(CONFIG_MEDIA_CONTROLLER)
> - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev)
> + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
> + vdev->vfl_type != VFL_TYPE_SUBDEV)
> media_device_unregister_entity(&vdev->entity);
> #endif
>
--
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com
next prev parent reply other threads:[~2011-04-12 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-11 14:26 [PATCH] v4l: Don't register media entities for subdev device nodes Laurent Pinchart
2011-04-12 12:35 ` Sakari Ailus [this message]
2011-07-04 13:11 ` Michael Jones
2011-07-04 13:21 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA44718.1090501@maxwell.research.nokia.com \
--to=sakari.ailus@maxwell.research.nokia.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox