]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
V4L/DVB (12429): v4l2-ioctl: fix G_STD and G_PARM default handlers
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 7 Aug 2009 10:28:16 +0000 (07:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 13 Aug 2009 23:39:12 +0000 (20:39 -0300)
commit9bedc7f7fe803c17d26b5fcf5786b50a7cf40def
treefe8424c5bc15080e8069cd040c2e170205fe1dc4
parent99362e1ece9f9651af1b849a01d91b9df1e0db2c
V4L/DVB (12429): v4l2-ioctl: fix G_STD and G_PARM default handlers

The v4l core supplies default handlers for G_STD and G_PARM. However, both
default handlers are buggy.

This patch fixes the following:

1) If no g_std is supplied and current_norm == 0, then this driver does not
   support TV video standards (e.g. a radio or webcam driver). Return
   -EINVAL. This ensures that there is no bogus VIDIOC_G_STD support for
   such drivers.

2) The default VIDIOC_G_PARM handler used current_norm instead of first
   checking if the driver supported g_std and calling that to get the norm.
   It also didn't check if current_norm was 0, since in that case the driver
   does not support TV standards (or no standard was set at all) and the
   default handler should return -EINVAL.

Note that I am very unhappy with these default handlers: I think they
basically behave like some very strange and unexpected side-effect.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/v4l2-ioctl.c