All of lore.kernel.org
 help / color / mirror / Atom feed
From: vkalia@codeaurora.org
To: unlisted-recipients:; (no To-header on input)@casper.infradead.org
Cc: linux-media@vger.kernel.org, vrajesh@codeaurora.org,
	laurent.pinchart@ideasonboard.com
Subject: Re: Custom device names for v4l2 devices
Date: Mon, 11 Mar 2013 10:55:37 -0700	[thread overview]
Message-ID: <a6da9ec89bbf3e28549a4a25efe3f166.squirrel@www.codeaurora.org> (raw)
In-Reply-To: <3fe50e59b4f7baeda879f4f7b2e5cc1a.squirrel@www.codeaurora.org>

Please suggest.

Thanks
Vinay

> Hi
>
> Names of V4L2 device nodes keep on varying depending on target, on some
> targets, the device node assigned to my device is /dev/video21 and on some
> it is /dev/video15. In order to determine my device, i am opening it,
> reading the capabilities, enumerating its formats and then chose the one
> matching my requirements. This is impacting start-up latency. One way to
> resolve this without impacting start-up latency is to give custom name to
> my V4L2 device node (/dev/custom_name instead of /dev/video21). This needs
> following change in V4L2 framework. Please review this patch. If you have
> faced similar problem please let me know.
>
> --- a/drivers/media/video/v4l2-dev.c
> +++ b/drivers/media/video/v4l2-dev.c
> @@ -676,7 +676,8 @@ int __video_register_device(struct video_device *vdev,
> int type, int nr,
>  	vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor);
>  	if (vdev->parent)
>  		vdev->dev.parent = vdev->parent;
> -	dev_set_name(&vdev->dev, "%s%d", name_base, vdev->num);
> +	if (!dev_name(&vdev->dev))
> +		dev_set_name(&vdev->dev, "%s%d", name_base, vdev->num);
>  	ret = device_register(&vdev->dev);
>  	if (ret < 0) {
>  		printk(KERN_ERR "%s: device_register failed\n", __func__);
>
>
> Thanks
> Vinay
>



  reply	other threads:[~2013-03-11 17:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08  2:11 Custom device names for v4l2 devices vkalia
2013-03-11 17:55 ` vkalia [this message]
2013-03-11 21:28   ` Laurent Pinchart
2013-03-14 15:45     ` David Dillow

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=a6da9ec89bbf3e28549a4a25efe3f166.squirrel@www.codeaurora.org \
    --to=vkalia@codeaurora.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=vrajesh@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.