diff mbox

vivi: remove pointless video_nr++

Message ID 201207192245.49852.hverkuil@xs4all.nl (mailing list archive)
State New, archived
Headers show

Commit Message

Hans Verkuil July 19, 2012, 8:45 p.m. UTC
Remove the pointless video_nr++. It doesn't do anything useful and it has
the unexpected side-effect of changing the video_nr module option, so
cat /sys/module/vivi/parameters/video_nr gives a different value back
then what was specified with modprobe.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ezequiel Garcia July 19, 2012, 9:05 p.m. UTC | #1
On Thu, Jul 19, 2012 at 5:45 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> Remove the pointless video_nr++. It doesn't do anything useful and it has
> the unexpected side-effect of changing the video_nr module option, so
> cat /sys/module/vivi/parameters/video_nr gives a different value back
> then what was specified with modprobe.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
> index 1e8c4f3..679e329 100644
> --- a/drivers/media/video/vivi.c
> +++ b/drivers/media/video/vivi.c
> @@ -1330,9 +1330,6 @@ static int __init vivi_create_instance(int inst)
>         /* Now that everything is fine, let's add it to device list */
>         list_add_tail(&dev->vivi_devlist, &vivi_devlist);
>
> -       if (video_nr != -1)
> -               video_nr++;
> -
>         v4l2_info(&dev->v4l2_dev, "V4L2 device registered as %s\n",
>                   video_device_node_name(vfd));
>         return 0;
> --

Hans,

I think you forgot to *also* remove the video_nr module parameter.
(and, of course, pass a '-1' to video_register_device)

Regards,
Ezequiel.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ezequiel Garcia July 19, 2012, 9:15 p.m. UTC | #2
On Thu, Jul 19, 2012 at 6:05 PM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> On Thu, Jul 19, 2012 at 5:45 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> Remove the pointless video_nr++. It doesn't do anything useful and it has
>> the unexpected side-effect of changing the video_nr module option, so
>> cat /sys/module/vivi/parameters/video_nr gives a different value back
>> then what was specified with modprobe.
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
>> index 1e8c4f3..679e329 100644
>> --- a/drivers/media/video/vivi.c
>> +++ b/drivers/media/video/vivi.c
>> @@ -1330,9 +1330,6 @@ static int __init vivi_create_instance(int inst)
>>         /* Now that everything is fine, let's add it to device list */
>>         list_add_tail(&dev->vivi_devlist, &vivi_devlist);
>>
>> -       if (video_nr != -1)
>> -               video_nr++;
>> -
>>         v4l2_info(&dev->v4l2_dev, "V4L2 device registered as %s\n",
>>                   video_device_node_name(vfd));
>>         return 0;
>> --
>
> Hans,
>
> I think you forgot to *also* remove the video_nr module parameter.
> (and, of course, pass a '-1' to video_register_device)
>

Or maybe not, :-) if you want to be able to force video device number.

Regards,
Ezequiel.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil July 20, 2012, 7:28 a.m. UTC | #3
On Thu July 19 2012 23:15:42 Ezequiel Garcia wrote:
> On Thu, Jul 19, 2012 at 6:05 PM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> > On Thu, Jul 19, 2012 at 5:45 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >> Remove the pointless video_nr++. It doesn't do anything useful and it has
> >> the unexpected side-effect of changing the video_nr module option, so
> >> cat /sys/module/vivi/parameters/video_nr gives a different value back
> >> then what was specified with modprobe.
> >>
> >> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> >>
> >> diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
> >> index 1e8c4f3..679e329 100644
> >> --- a/drivers/media/video/vivi.c
> >> +++ b/drivers/media/video/vivi.c
> >> @@ -1330,9 +1330,6 @@ static int __init vivi_create_instance(int inst)
> >>         /* Now that everything is fine, let's add it to device list */
> >>         list_add_tail(&dev->vivi_devlist, &vivi_devlist);
> >>
> >> -       if (video_nr != -1)
> >> -               video_nr++;
> >> -
> >>         v4l2_info(&dev->v4l2_dev, "V4L2 device registered as %s\n",
> >>                   video_device_node_name(vfd));
> >>         return 0;
> >> --
> >
> > Hans,
> >
> > I think you forgot to *also* remove the video_nr module parameter.
> > (and, of course, pass a '-1' to video_register_device)
> >
> 
> Or maybe not, :-) if you want to be able to force video device number.

Some people apparently want to force it. I never understood why, but enough
people do it so that we can't remove it.

Regards,

	Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 1e8c4f3..679e329 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1330,9 +1330,6 @@  static int __init vivi_create_instance(int inst)
 	/* Now that everything is fine, let's add it to device list */
 	list_add_tail(&dev->vivi_devlist, &vivi_devlist);
 
-	if (video_nr != -1)
-		video_nr++;
-
 	v4l2_info(&dev->v4l2_dev, "V4L2 device registered as %s\n",
 		  video_device_node_name(vfd));
 	return 0;