All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] Remove linux/version.h from most drivers/media
@ 2011-06-26 16:06 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 7+ messages in thread
From: Mauro Carvalho Chehab @ 2011-06-26 16:06 UTC (permalink / raw)
  Cc: Linux Media Mailing List, LKML, Laurent Pincart, Mike Isely

At the V4L2 API, one of the fields of VIDIOC_QUERYCAP requires the usage
of KERNEL_VERSION macro, in order to provide the driver version. However,
this is not handled consistently across subsystems. There are very few
drivers that take it seriously.

So, instead of the current way, let's replace it by a subsystem version.
Removing the driver-specific version reported via V4L2 API is a good
thing, due to several reasons:
	1) every time include/linux/version.h changes, all media drivers
	   need to be recompiled;
	2) eventually, this macro will be changed at Kernel 3.x;
	3) developers are lazy on updating it at a per-driver basis; 
	   The information  there is not consistent;
	4) a check for the V4L2 API, incremented as new changes are added
	   means that the changes will happen on a consistent way, being 
	   incremented when new features are added at the Kernel;
	5) From time to time, people do the wrong thing, including version.h
	   where it is not needed, and spending Kernel Janitor's time to 
	   cleanup the mess.

There's one additional reason for the change: before this patch series,
a call to an unsupported ioctl would be returning -EINVAL. So, userspace
applications can't detect if the error were due to invalid parameters,
or to unsupported ioctl. This series changes the behavior to return
-ENOIOCTLCMD for non-supported ioctl's.

So, after this patch series, if VIDIOC_QUERYCAP returns version 3.x.y,
userspace applications can rely on -ENOIOCTLCMD in order to detect that
an ioctl is not supported by a given driver.

After this patch series, the only places at drivers/media that will keep 
linux/version.h are:
	drivers/media/video/et61x251/et61x251_core.c
	drivers/media/video/pvrusb2/pvrusb2-v4l2.c
	drivers/media/video/sn9c102/sn9c102_core.c
	drivers/media/video/uvc/uvc_driver.c
	drivers/media/video/uvc/uvc_v4l2.c
And, of course: drivers/media/video/v4l2-ioctl.c

The rationale is that et61x251, pvrusb2, sn9c102 and uvc uses the
legacy way of handling ioctl's. Two of those drivers are obsoleted by
gspca. The other two drivers (pvrusb2 and uvc) needs porting.

Mauro Carvalho Chehab (14):
  [media] v4l2 core: return -ENOIOCTLCMD if an ioctl doesn't exist
  [media] return -ENOIOCTLCMD for unsupported ioctl's at legacy drivers
  [media] v4l2-ioctl: Add a default value for kernel version
  [media] drxd, siano: Remove unused include linux/version.h
  [media] Stop using linux/version.h on most video drivers
  [media] pwc: Use the default version for VIDIOC_QUERYCAP
  [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP
  [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] sn9c102: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] Stop using linux/version.h the remaining video drivers
  [media] radio: Use the subsystem version control for VIDIOC_QUERYCAP
  [media] DocBook/v4l: Document the new system-wide version behavior

 Documentation/DocBook/media/Makefile               |    1 +
 Documentation/DocBook/media/v4l/common.xml         |   10 ++++++++-
 Documentation/DocBook/media/v4l/func-ioctl.xml     |   17 ++++++++-------
 Documentation/DocBook/media/v4l/v4l2.xml           |    7 ++++++
 .../DocBook/media/v4l/vidioc-querycap.xml          |   15 ++++++++-----
 drivers/media/dvb/frontends/drxd_hard.c            |    1 -
 drivers/media/dvb/siano/smscoreapi.h               |    1 -
 drivers/media/radio/dsbr100.c                      |    7 +----
 drivers/media/radio/radio-aimslab.c                |    5 +---
 drivers/media/radio/radio-aztech.c                 |    5 +---
 drivers/media/radio/radio-cadet.c                  |    5 +---
 drivers/media/radio/radio-gemtek.c                 |    7 +----
 drivers/media/radio/radio-maxiradio.c              |   10 +++-----
 drivers/media/radio/radio-mr800.c                  |    6 +---
 drivers/media/radio/radio-rtrack2.c                |    5 +---
 drivers/media/radio/radio-sf16fmi.c                |    5 +---
 drivers/media/radio/radio-tea5764.c                |    6 +---
 drivers/media/radio/radio-terratec.c               |    5 +---
 drivers/media/radio/radio-timb.c                   |    3 +-
 drivers/media/radio/radio-trust.c                  |    5 +---
 drivers/media/radio/radio-typhoon.c                |    9 +++----
 drivers/media/radio/radio-zoltrix.c                |    5 +---
 drivers/media/radio/si470x/radio-si470x-i2c.c      |    4 +--
 drivers/media/radio/si470x/radio-si470x-usb.c      |    2 -
 drivers/media/radio/si470x/radio-si470x.h          |    1 -
 drivers/media/radio/wl128x/fmdrv.h                 |    5 +---
 drivers/media/radio/wl128x/fmdrv_v4l2.c            |    1 -
 drivers/media/video/arv.c                          |    5 +--
 drivers/media/video/au0828/au0828-core.c           |    1 +
 drivers/media/video/au0828/au0828-video.c          |    5 ----
 drivers/media/video/bt8xx/bttv-driver.c            |   14 +++---------
 drivers/media/video/bt8xx/bttvp.h                  |    3 --
 drivers/media/video/bw-qcam.c                      |    3 +-
 drivers/media/video/c-qcam.c                       |    3 +-
 drivers/media/video/cpia2/cpia2.h                  |    5 ----
 drivers/media/video/cpia2/cpia2_v4l.c              |   12 +++-------
 drivers/media/video/cx18/cx18-driver.h             |    1 -
 drivers/media/video/cx18/cx18-ioctl.c              |    1 -
 drivers/media/video/cx18/cx18-version.h            |    8 +------
 drivers/media/video/cx231xx/cx231xx-video.c        |   14 +++---------
 drivers/media/video/cx231xx/cx231xx.h              |    1 -
 drivers/media/video/cx23885/altera-ci.c            |    1 -
 drivers/media/video/cx23885/cx23885-417.c          |    1 -
 drivers/media/video/cx23885/cx23885-core.c         |   13 ++---------
 drivers/media/video/cx23885/cx23885-video.c        |    1 -
 drivers/media/video/cx23885/cx23885.h              |    3 +-
 drivers/media/video/cx88/cx88-alsa.c               |   19 +++--------------
 drivers/media/video/cx88/cx88-blackbird.c          |   20 ++----------------
 drivers/media/video/cx88/cx88-dvb.c                |   18 ++--------------
 drivers/media/video/cx88/cx88-mpeg.c               |   11 ++-------
 drivers/media/video/cx88/cx88-video.c              |   21 ++-----------------
 drivers/media/video/cx88/cx88.h                    |    4 +-
 drivers/media/video/davinci/vpif_capture.c         |    9 ++-----
 drivers/media/video/davinci/vpif_capture.h         |    7 +-----
 drivers/media/video/davinci/vpif_display.c         |    9 ++-----
 drivers/media/video/davinci/vpif_display.h         |    8 +------
 drivers/media/video/em28xx/em28xx-video.c          |   14 ++++--------
 drivers/media/video/et61x251/et61x251.h            |    1 -
 drivers/media/video/et61x251/et61x251_core.c       |   16 +++-----------
 drivers/media/video/fsl-viu.c                      |   10 +-------
 drivers/media/video/gspca/gl860/gl860.h            |    1 -
 drivers/media/video/gspca/gspca.c                  |   12 +++-------
 drivers/media/video/hdpvr/hdpvr-core.c             |    1 +
 drivers/media/video/hdpvr/hdpvr-video.c            |    2 -
 drivers/media/video/hdpvr/hdpvr.h                  |    6 -----
 drivers/media/video/ivtv/ivtv-driver.h             |    1 -
 drivers/media/video/ivtv/ivtv-ioctl.c              |    1 -
 drivers/media/video/ivtv/ivtv-version.h            |    7 +-----
 drivers/media/video/m5mols/m5mols_capture.c        |    2 -
 drivers/media/video/m5mols/m5mols_core.c           |    1 -
 drivers/media/video/mem2mem_testdev.c              |    4 +--
 drivers/media/video/mx1_camera.c                   |    5 +--
 drivers/media/video/mx2_camera.c                   |    5 +--
 drivers/media/video/mx3_camera.c                   |    3 +-
 drivers/media/video/omap1_camera.c                 |    5 +--
 drivers/media/video/omap24xxcam.c                  |    5 +--
 drivers/media/video/omap3isp/isp.c                 |    1 +
 drivers/media/video/omap3isp/ispvideo.c            |    1 -
 drivers/media/video/omap3isp/ispvideo.h            |    3 +-
 drivers/media/video/pms.c                          |    4 +--
 drivers/media/video/pvrusb2/pvrusb2-main.c         |    1 +
 drivers/media/video/pvrusb2/pvrusb2-v4l2.c         |    9 +------
 drivers/media/video/pwc/pwc-ioctl.h                |    1 -
 drivers/media/video/pwc/pwc-v4l.c                  |    1 -
 drivers/media/video/pwc/pwc.h                      |    7 +-----
 drivers/media/video/pxa_camera.c                   |    5 +--
 drivers/media/video/s2255drv.c                     |   15 +++----------
 drivers/media/video/s5p-fimc/fimc-capture.c        |    2 -
 drivers/media/video/s5p-fimc/fimc-core.c           |    3 +-
 drivers/media/video/saa7134/saa7134-core.c         |   12 +++-------
 drivers/media/video/saa7134/saa7134-empress.c      |    1 -
 drivers/media/video/saa7134/saa7134-video.c        |    2 -
 drivers/media/video/saa7134/saa7134.h              |    3 +-
 drivers/media/video/saa7164/saa7164.h              |    1 -
 drivers/media/video/sh_mobile_ceu_camera.c         |    3 +-
 drivers/media/video/sh_vou.c                       |    3 +-
 drivers/media/video/sn9c102/sn9c102.h              |    1 -
 drivers/media/video/sn9c102/sn9c102_core.c         |   16 +++-----------
 drivers/media/video/timblogiw.c                    |    1 -
 drivers/media/video/tlg2300/pd-common.h            |    1 -
 drivers/media/video/tlg2300/pd-main.c              |    1 +
 drivers/media/video/tlg2300/pd-radio.c             |    2 -
 drivers/media/video/usbvision/usbvision-video.c    |   12 +----------
 drivers/media/video/uvc/uvc_driver.c               |    3 +-
 drivers/media/video/uvc/uvc_v4l2.c                 |    4 +-
 drivers/media/video/uvc/uvcvideo.h                 |    3 +-
 drivers/media/video/v4l2-ioctl.c                   |    6 +++-
 drivers/media/video/vino.c                         |    5 +---
 drivers/media/video/vivi.c                         |   14 +++---------
 drivers/media/video/w9966.c                        |    4 +--
 drivers/media/video/zoran/zoran.h                  |    4 ---
 drivers/media/video/zoran/zoran_card.c             |    7 ++++-
 drivers/media/video/zoran/zoran_driver.c           |    3 --
 drivers/media/video/zr364xx.c                      |    6 +---
 114 files changed, 186 insertions(+), 461 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 00/14] Remove linux/version.h from most drivers/media
@ 2011-06-26 16:06 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 7+ messages in thread
From: Mauro Carvalho Chehab @ 2011-06-26 16:06 UTC (permalink / raw)
  Cc: Linux Media Mailing List, LKML, Laurent Pincart, Mike Isely

At the V4L2 API, one of the fields of VIDIOC_QUERYCAP requires the usage
of KERNEL_VERSION macro, in order to provide the driver version. However,
this is not handled consistently across subsystems. There are very few
drivers that take it seriously.

So, instead of the current way, let's replace it by a subsystem version.
Removing the driver-specific version reported via V4L2 API is a good
thing, due to several reasons:
	1) every time include/linux/version.h changes, all media drivers
	   need to be recompiled;
	2) eventually, this macro will be changed at Kernel 3.x;
	3) developers are lazy on updating it at a per-driver basis; 
	   The information  there is not consistent;
	4) a check for the V4L2 API, incremented as new changes are added
	   means that the changes will happen on a consistent way, being 
	   incremented when new features are added at the Kernel;
	5) From time to time, people do the wrong thing, including version.h
	   where it is not needed, and spending Kernel Janitor's time to 
	   cleanup the mess.

There's one additional reason for the change: before this patch series,
a call to an unsupported ioctl would be returning -EINVAL. So, userspace
applications can't detect if the error were due to invalid parameters,
or to unsupported ioctl. This series changes the behavior to return
-ENOIOCTLCMD for non-supported ioctl's.

So, after this patch series, if VIDIOC_QUERYCAP returns version 3.x.y,
userspace applications can rely on -ENOIOCTLCMD in order to detect that
an ioctl is not supported by a given driver.

After this patch series, the only places at drivers/media that will keep 
linux/version.h are:
	drivers/media/video/et61x251/et61x251_core.c
	drivers/media/video/pvrusb2/pvrusb2-v4l2.c
	drivers/media/video/sn9c102/sn9c102_core.c
	drivers/media/video/uvc/uvc_driver.c
	drivers/media/video/uvc/uvc_v4l2.c
And, of course: drivers/media/video/v4l2-ioctl.c

The rationale is that et61x251, pvrusb2, sn9c102 and uvc uses the
legacy way of handling ioctl's. Two of those drivers are obsoleted by
gspca. The other two drivers (pvrusb2 and uvc) needs porting.

Mauro Carvalho Chehab (14):
  [media] v4l2 core: return -ENOIOCTLCMD if an ioctl doesn't exist
  [media] return -ENOIOCTLCMD for unsupported ioctl's at legacy drivers
  [media] v4l2-ioctl: Add a default value for kernel version
  [media] drxd, siano: Remove unused include linux/version.h
  [media] Stop using linux/version.h on most video drivers
  [media] pwc: Use the default version for VIDIOC_QUERYCAP
  [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP
  [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] sn9c102: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
  [media] Stop using linux/version.h the remaining video drivers
  [media] radio: Use the subsystem version control for VIDIOC_QUERYCAP
  [media] DocBook/v4l: Document the new system-wide version behavior

 Documentation/DocBook/media/Makefile               |    1 +
 Documentation/DocBook/media/v4l/common.xml         |   10 ++++++++-
 Documentation/DocBook/media/v4l/func-ioctl.xml     |   17 ++++++++-------
 Documentation/DocBook/media/v4l/v4l2.xml           |    7 ++++++
 .../DocBook/media/v4l/vidioc-querycap.xml          |   15 ++++++++-----
 drivers/media/dvb/frontends/drxd_hard.c            |    1 -
 drivers/media/dvb/siano/smscoreapi.h               |    1 -
 drivers/media/radio/dsbr100.c                      |    7 +----
 drivers/media/radio/radio-aimslab.c                |    5 +---
 drivers/media/radio/radio-aztech.c                 |    5 +---
 drivers/media/radio/radio-cadet.c                  |    5 +---
 drivers/media/radio/radio-gemtek.c                 |    7 +----
 drivers/media/radio/radio-maxiradio.c              |   10 +++-----
 drivers/media/radio/radio-mr800.c                  |    6 +---
 drivers/media/radio/radio-rtrack2.c                |    5 +---
 drivers/media/radio/radio-sf16fmi.c                |    5 +---
 drivers/media/radio/radio-tea5764.c                |    6 +---
 drivers/media/radio/radio-terratec.c               |    5 +---
 drivers/media/radio/radio-timb.c                   |    3 +-
 drivers/media/radio/radio-trust.c                  |    5 +---
 drivers/media/radio/radio-typhoon.c                |    9 +++----
 drivers/media/radio/radio-zoltrix.c                |    5 +---
 drivers/media/radio/si470x/radio-si470x-i2c.c      |    4 +--
 drivers/media/radio/si470x/radio-si470x-usb.c      |    2 -
 drivers/media/radio/si470x/radio-si470x.h          |    1 -
 drivers/media/radio/wl128x/fmdrv.h                 |    5 +---
 drivers/media/radio/wl128x/fmdrv_v4l2.c            |    1 -
 drivers/media/video/arv.c                          |    5 +--
 drivers/media/video/au0828/au0828-core.c           |    1 +
 drivers/media/video/au0828/au0828-video.c          |    5 ----
 drivers/media/video/bt8xx/bttv-driver.c            |   14 +++---------
 drivers/media/video/bt8xx/bttvp.h                  |    3 --
 drivers/media/video/bw-qcam.c                      |    3 +-
 drivers/media/video/c-qcam.c                       |    3 +-
 drivers/media/video/cpia2/cpia2.h                  |    5 ----
 drivers/media/video/cpia2/cpia2_v4l.c              |   12 +++-------
 drivers/media/video/cx18/cx18-driver.h             |    1 -
 drivers/media/video/cx18/cx18-ioctl.c              |    1 -
 drivers/media/video/cx18/cx18-version.h            |    8 +------
 drivers/media/video/cx231xx/cx231xx-video.c        |   14 +++---------
 drivers/media/video/cx231xx/cx231xx.h              |    1 -
 drivers/media/video/cx23885/altera-ci.c            |    1 -
 drivers/media/video/cx23885/cx23885-417.c          |    1 -
 drivers/media/video/cx23885/cx23885-core.c         |   13 ++---------
 drivers/media/video/cx23885/cx23885-video.c        |    1 -
 drivers/media/video/cx23885/cx23885.h              |    3 +-
 drivers/media/video/cx88/cx88-alsa.c               |   19 +++--------------
 drivers/media/video/cx88/cx88-blackbird.c          |   20 ++----------------
 drivers/media/video/cx88/cx88-dvb.c                |   18 ++--------------
 drivers/media/video/cx88/cx88-mpeg.c               |   11 ++-------
 drivers/media/video/cx88/cx88-video.c              |   21 ++-----------------
 drivers/media/video/cx88/cx88.h                    |    4 +-
 drivers/media/video/davinci/vpif_capture.c         |    9 ++-----
 drivers/media/video/davinci/vpif_capture.h         |    7 +-----
 drivers/media/video/davinci/vpif_display.c         |    9 ++-----
 drivers/media/video/davinci/vpif_display.h         |    8 +------
 drivers/media/video/em28xx/em28xx-video.c          |   14 ++++--------
 drivers/media/video/et61x251/et61x251.h            |    1 -
 drivers/media/video/et61x251/et61x251_core.c       |   16 +++-----------
 drivers/media/video/fsl-viu.c                      |   10 +-------
 drivers/media/video/gspca/gl860/gl860.h            |    1 -
 drivers/media/video/gspca/gspca.c                  |   12 +++-------
 drivers/media/video/hdpvr/hdpvr-core.c             |    1 +
 drivers/media/video/hdpvr/hdpvr-video.c            |    2 -
 drivers/media/video/hdpvr/hdpvr.h                  |    6 -----
 drivers/media/video/ivtv/ivtv-driver.h             |    1 -
 drivers/media/video/ivtv/ivtv-ioctl.c              |    1 -
 drivers/media/video/ivtv/ivtv-version.h            |    7 +-----
 drivers/media/video/m5mols/m5mols_capture.c        |    2 -
 drivers/media/video/m5mols/m5mols_core.c           |    1 -
 drivers/media/video/mem2mem_testdev.c              |    4 +--
 drivers/media/video/mx1_camera.c                   |    5 +--
 drivers/media/video/mx2_camera.c                   |    5 +--
 drivers/media/video/mx3_camera.c                   |    3 +-
 drivers/media/video/omap1_camera.c                 |    5 +--
 drivers/media/video/omap24xxcam.c                  |    5 +--
 drivers/media/video/omap3isp/isp.c                 |    1 +
 drivers/media/video/omap3isp/ispvideo.c            |    1 -
 drivers/media/video/omap3isp/ispvideo.h            |    3 +-
 drivers/media/video/pms.c                          |    4 +--
 drivers/media/video/pvrusb2/pvrusb2-main.c         |    1 +
 drivers/media/video/pvrusb2/pvrusb2-v4l2.c         |    9 +------
 drivers/media/video/pwc/pwc-ioctl.h                |    1 -
 drivers/media/video/pwc/pwc-v4l.c                  |    1 -
 drivers/media/video/pwc/pwc.h                      |    7 +-----
 drivers/media/video/pxa_camera.c                   |    5 +--
 drivers/media/video/s2255drv.c                     |   15 +++----------
 drivers/media/video/s5p-fimc/fimc-capture.c        |    2 -
 drivers/media/video/s5p-fimc/fimc-core.c           |    3 +-
 drivers/media/video/saa7134/saa7134-core.c         |   12 +++-------
 drivers/media/video/saa7134/saa7134-empress.c      |    1 -
 drivers/media/video/saa7134/saa7134-video.c        |    2 -
 drivers/media/video/saa7134/saa7134.h              |    3 +-
 drivers/media/video/saa7164/saa7164.h              |    1 -
 drivers/media/video/sh_mobile_ceu_camera.c         |    3 +-
 drivers/media/video/sh_vou.c                       |    3 +-
 drivers/media/video/sn9c102/sn9c102.h              |    1 -
 drivers/media/video/sn9c102/sn9c102_core.c         |   16 +++-----------
 drivers/media/video/timblogiw.c                    |    1 -
 drivers/media/video/tlg2300/pd-common.h            |    1 -
 drivers/media/video/tlg2300/pd-main.c              |    1 +
 drivers/media/video/tlg2300/pd-radio.c             |    2 -
 drivers/media/video/usbvision/usbvision-video.c    |   12 +----------
 drivers/media/video/uvc/uvc_driver.c               |    3 +-
 drivers/media/video/uvc/uvc_v4l2.c                 |    4 +-
 drivers/media/video/uvc/uvcvideo.h                 |    3 +-
 drivers/media/video/v4l2-ioctl.c                   |    6 +++-
 drivers/media/video/vino.c                         |    5 +---
 drivers/media/video/vivi.c                         |   14 +++---------
 drivers/media/video/w9966.c                        |    4 +--
 drivers/media/video/zoran/zoran.h                  |    4 ---
 drivers/media/video/zoran/zoran_card.c             |    7 ++++-
 drivers/media/video/zoran/zoran_driver.c           |    3 --
 drivers/media/video/zr364xx.c                      |    6 +---
 114 files changed, 186 insertions(+), 461 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/14] Remove linux/version.h from most drivers/media
  2011-06-26 16:06 ` Mauro Carvalho Chehab
  (?)
@ 2011-06-26 17:55 ` Hans Verkuil
  -1 siblings, 0 replies; 7+ messages in thread
From: Hans Verkuil @ 2011-06-26 17:55 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: LKML, Laurent Pincart, Mike Isely

On Sunday, June 26, 2011 18:06:20 Mauro Carvalho Chehab wrote:
> At the V4L2 API, one of the fields of VIDIOC_QUERYCAP requires the usage
> of KERNEL_VERSION macro, in order to provide the driver version. However,
> this is not handled consistently across subsystems. There are very few
> drivers that take it seriously.
> 
> So, instead of the current way, let's replace it by a subsystem version.
> Removing the driver-specific version reported via V4L2 API is a good
> thing, due to several reasons:
> 	1) every time include/linux/version.h changes, all media drivers
> 	   need to be recompiled;
> 	2) eventually, this macro will be changed at Kernel 3.x;
> 	3) developers are lazy on updating it at a per-driver basis; 
> 	   The information  there is not consistent;
> 	4) a check for the V4L2 API, incremented as new changes are added
> 	   means that the changes will happen on a consistent way, being 
> 	   incremented when new features are added at the Kernel;
> 	5) From time to time, people do the wrong thing, including version.h
> 	   where it is not needed, and spending Kernel Janitor's time to 
> 	   cleanup the mess.
> 
> There's one additional reason for the change: before this patch series,
> a call to an unsupported ioctl would be returning -EINVAL. So, userspace
> applications can't detect if the error were due to invalid parameters,
> or to unsupported ioctl. This series changes the behavior to return
> -ENOIOCTLCMD for non-supported ioctl's.
> 
> So, after this patch series, if VIDIOC_QUERYCAP returns version 3.x.y,
> userspace applications can rely on -ENOIOCTLCMD in order to detect that
> an ioctl is not supported by a given driver.
> 
> After this patch series, the only places at drivers/media that will keep 
> linux/version.h are:
> 	drivers/media/video/et61x251/et61x251_core.c
> 	drivers/media/video/pvrusb2/pvrusb2-v4l2.c
> 	drivers/media/video/sn9c102/sn9c102_core.c
> 	drivers/media/video/uvc/uvc_driver.c
> 	drivers/media/video/uvc/uvc_v4l2.c
> And, of course: drivers/media/video/v4l2-ioctl.c
> 
> The rationale is that et61x251, pvrusb2, sn9c102 and uvc uses the
> legacy way of handling ioctl's. Two of those drivers are obsoleted by
> gspca. The other two drivers (pvrusb2 and uvc) needs porting.

Except for the ENOIOCTLCMD changes:

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

I suggest that the ENOIOCTLCMD changes are in a separate patch series due to
the uncertainty of what the right return code is.

Also, while it would be great to have a different ioctl than EINVAL for unsupported
ioctls, I am afraid of breaking existing applications. Some may rely on this.

Regards,

	Hans

> 
> Mauro Carvalho Chehab (14):
>   [media] v4l2 core: return -ENOIOCTLCMD if an ioctl doesn't exist
>   [media] return -ENOIOCTLCMD for unsupported ioctl's at legacy drivers
>   [media] v4l2-ioctl: Add a default value for kernel version
>   [media] drxd, siano: Remove unused include linux/version.h
>   [media] Stop using linux/version.h on most video drivers
>   [media] pwc: Use the default version for VIDIOC_QUERYCAP
>   [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP
>   [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
>   [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
>   [media] sn9c102: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
>   [media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
>   [media] Stop using linux/version.h the remaining video drivers
>   [media] radio: Use the subsystem version control for VIDIOC_QUERYCAP
>   [media] DocBook/v4l: Document the new system-wide version behavior
> 
>  Documentation/DocBook/media/Makefile               |    1 +
>  Documentation/DocBook/media/v4l/common.xml         |   10 ++++++++-
>  Documentation/DocBook/media/v4l/func-ioctl.xml     |   17 ++++++++-------
>  Documentation/DocBook/media/v4l/v4l2.xml           |    7 ++++++
>  .../DocBook/media/v4l/vidioc-querycap.xml          |   15 ++++++++-----
>  drivers/media/dvb/frontends/drxd_hard.c            |    1 -
>  drivers/media/dvb/siano/smscoreapi.h               |    1 -
>  drivers/media/radio/dsbr100.c                      |    7 +----
>  drivers/media/radio/radio-aimslab.c                |    5 +---
>  drivers/media/radio/radio-aztech.c                 |    5 +---
>  drivers/media/radio/radio-cadet.c                  |    5 +---
>  drivers/media/radio/radio-gemtek.c                 |    7 +----
>  drivers/media/radio/radio-maxiradio.c              |   10 +++-----
>  drivers/media/radio/radio-mr800.c                  |    6 +---
>  drivers/media/radio/radio-rtrack2.c                |    5 +---
>  drivers/media/radio/radio-sf16fmi.c                |    5 +---
>  drivers/media/radio/radio-tea5764.c                |    6 +---
>  drivers/media/radio/radio-terratec.c               |    5 +---
>  drivers/media/radio/radio-timb.c                   |    3 +-
>  drivers/media/radio/radio-trust.c                  |    5 +---
>  drivers/media/radio/radio-typhoon.c                |    9 +++----
>  drivers/media/radio/radio-zoltrix.c                |    5 +---
>  drivers/media/radio/si470x/radio-si470x-i2c.c      |    4 +--
>  drivers/media/radio/si470x/radio-si470x-usb.c      |    2 -
>  drivers/media/radio/si470x/radio-si470x.h          |    1 -
>  drivers/media/radio/wl128x/fmdrv.h                 |    5 +---
>  drivers/media/radio/wl128x/fmdrv_v4l2.c            |    1 -
>  drivers/media/video/arv.c                          |    5 +--
>  drivers/media/video/au0828/au0828-core.c           |    1 +
>  drivers/media/video/au0828/au0828-video.c          |    5 ----
>  drivers/media/video/bt8xx/bttv-driver.c            |   14 +++---------
>  drivers/media/video/bt8xx/bttvp.h                  |    3 --
>  drivers/media/video/bw-qcam.c                      |    3 +-
>  drivers/media/video/c-qcam.c                       |    3 +-
>  drivers/media/video/cpia2/cpia2.h                  |    5 ----
>  drivers/media/video/cpia2/cpia2_v4l.c              |   12 +++-------
>  drivers/media/video/cx18/cx18-driver.h             |    1 -
>  drivers/media/video/cx18/cx18-ioctl.c              |    1 -
>  drivers/media/video/cx18/cx18-version.h            |    8 +------
>  drivers/media/video/cx231xx/cx231xx-video.c        |   14 +++---------
>  drivers/media/video/cx231xx/cx231xx.h              |    1 -
>  drivers/media/video/cx23885/altera-ci.c            |    1 -
>  drivers/media/video/cx23885/cx23885-417.c          |    1 -
>  drivers/media/video/cx23885/cx23885-core.c         |   13 ++---------
>  drivers/media/video/cx23885/cx23885-video.c        |    1 -
>  drivers/media/video/cx23885/cx23885.h              |    3 +-
>  drivers/media/video/cx88/cx88-alsa.c               |   19 +++--------------
>  drivers/media/video/cx88/cx88-blackbird.c          |   20 ++----------------
>  drivers/media/video/cx88/cx88-dvb.c                |   18 ++--------------
>  drivers/media/video/cx88/cx88-mpeg.c               |   11 ++-------
>  drivers/media/video/cx88/cx88-video.c              |   21 ++-----------------
>  drivers/media/video/cx88/cx88.h                    |    4 +-
>  drivers/media/video/davinci/vpif_capture.c         |    9 ++-----
>  drivers/media/video/davinci/vpif_capture.h         |    7 +-----
>  drivers/media/video/davinci/vpif_display.c         |    9 ++-----
>  drivers/media/video/davinci/vpif_display.h         |    8 +------
>  drivers/media/video/em28xx/em28xx-video.c          |   14 ++++--------
>  drivers/media/video/et61x251/et61x251.h            |    1 -
>  drivers/media/video/et61x251/et61x251_core.c       |   16 +++-----------
>  drivers/media/video/fsl-viu.c                      |   10 +-------
>  drivers/media/video/gspca/gl860/gl860.h            |    1 -
>  drivers/media/video/gspca/gspca.c                  |   12 +++-------
>  drivers/media/video/hdpvr/hdpvr-core.c             |    1 +
>  drivers/media/video/hdpvr/hdpvr-video.c            |    2 -
>  drivers/media/video/hdpvr/hdpvr.h                  |    6 -----
>  drivers/media/video/ivtv/ivtv-driver.h             |    1 -
>  drivers/media/video/ivtv/ivtv-ioctl.c              |    1 -
>  drivers/media/video/ivtv/ivtv-version.h            |    7 +-----
>  drivers/media/video/m5mols/m5mols_capture.c        |    2 -
>  drivers/media/video/m5mols/m5mols_core.c           |    1 -
>  drivers/media/video/mem2mem_testdev.c              |    4 +--
>  drivers/media/video/mx1_camera.c                   |    5 +--
>  drivers/media/video/mx2_camera.c                   |    5 +--
>  drivers/media/video/mx3_camera.c                   |    3 +-
>  drivers/media/video/omap1_camera.c                 |    5 +--
>  drivers/media/video/omap24xxcam.c                  |    5 +--
>  drivers/media/video/omap3isp/isp.c                 |    1 +
>  drivers/media/video/omap3isp/ispvideo.c            |    1 -
>  drivers/media/video/omap3isp/ispvideo.h            |    3 +-
>  drivers/media/video/pms.c                          |    4 +--
>  drivers/media/video/pvrusb2/pvrusb2-main.c         |    1 +
>  drivers/media/video/pvrusb2/pvrusb2-v4l2.c         |    9 +------
>  drivers/media/video/pwc/pwc-ioctl.h                |    1 -
>  drivers/media/video/pwc/pwc-v4l.c                  |    1 -
>  drivers/media/video/pwc/pwc.h                      |    7 +-----
>  drivers/media/video/pxa_camera.c                   |    5 +--
>  drivers/media/video/s2255drv.c                     |   15 +++----------
>  drivers/media/video/s5p-fimc/fimc-capture.c        |    2 -
>  drivers/media/video/s5p-fimc/fimc-core.c           |    3 +-
>  drivers/media/video/saa7134/saa7134-core.c         |   12 +++-------
>  drivers/media/video/saa7134/saa7134-empress.c      |    1 -
>  drivers/media/video/saa7134/saa7134-video.c        |    2 -
>  drivers/media/video/saa7134/saa7134.h              |    3 +-
>  drivers/media/video/saa7164/saa7164.h              |    1 -
>  drivers/media/video/sh_mobile_ceu_camera.c         |    3 +-
>  drivers/media/video/sh_vou.c                       |    3 +-
>  drivers/media/video/sn9c102/sn9c102.h              |    1 -
>  drivers/media/video/sn9c102/sn9c102_core.c         |   16 +++-----------
>  drivers/media/video/timblogiw.c                    |    1 -
>  drivers/media/video/tlg2300/pd-common.h            |    1 -
>  drivers/media/video/tlg2300/pd-main.c              |    1 +
>  drivers/media/video/tlg2300/pd-radio.c             |    2 -
>  drivers/media/video/usbvision/usbvision-video.c    |   12 +----------
>  drivers/media/video/uvc/uvc_driver.c               |    3 +-
>  drivers/media/video/uvc/uvc_v4l2.c                 |    4 +-
>  drivers/media/video/uvc/uvcvideo.h                 |    3 +-
>  drivers/media/video/v4l2-ioctl.c                   |    6 +++-
>  drivers/media/video/vino.c                         |    5 +---
>  drivers/media/video/vivi.c                         |   14 +++---------
>  drivers/media/video/w9966.c                        |    4 +--
>  drivers/media/video/zoran/zoran.h                  |    4 ---
>  drivers/media/video/zoran/zoran_card.c             |    7 ++++-
>  drivers/media/video/zoran/zoran_driver.c           |    3 --
>  drivers/media/video/zr364xx.c                      |    6 +---
>  114 files changed, 186 insertions(+), 461 deletions(-)
> 
> --
> 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
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/14] Remove linux/version.h from most drivers/media
  2011-06-26 16:06 ` Mauro Carvalho Chehab
  (?)
  (?)
@ 2011-06-26 18:14 ` Jean-Francois Moine
  2011-06-26 18:55   ` Mauro Carvalho Chehab
  -1 siblings, 1 reply; 7+ messages in thread
From: Jean-Francois Moine @ 2011-06-26 18:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List

On Sun, 26 Jun 2011 13:06:20 -0300
Mauro Carvalho Chehab <mchehab@redhat.com> wrote:

> drivers/media/video/gspca/gspca.c                  |   12 +++-------

Hi Mauro,

I could not find the gspca.c changes in your patch set.

Cheers.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/14] Remove linux/version.h from most drivers/media
  2011-06-26 18:14 ` Jean-Francois Moine
@ 2011-06-26 18:55   ` Mauro Carvalho Chehab
  2011-06-27 10:45     ` Jean-Francois Moine
  0 siblings, 1 reply; 7+ messages in thread
From: Mauro Carvalho Chehab @ 2011-06-26 18:55 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: Linux Media Mailing List

Em 26-06-2011 15:14, Jean-Francois Moine escreveu:
> On Sun, 26 Jun 2011 13:06:20 -0300
> Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
> 
>> drivers/media/video/gspca/gspca.c                  |   12 +++-------
> 
> Hi Mauro,
> 
> I could not find the gspca.c changes in your patch set.

It was fold at the wrong changeset. it is at: 

    [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
    
    et61x251 doesn't use vidioc_ioctl2. As the API is changing to use
    a common version for all drivers, we need to expliticly fix this
    driver.
    
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

I'll move it to the right changeset at the version 2 of this series.

Mauro

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/14] Remove linux/version.h from most drivers/media
  2011-06-26 18:55   ` Mauro Carvalho Chehab
@ 2011-06-27 10:45     ` Jean-Francois Moine
  2011-06-28  1:50       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Francois Moine @ 2011-06-27 10:45 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Sun, 26 Jun 2011 15:55:08 -0300
Mauro Carvalho Chehab <mchehab@redhat.com> wrote:

> I'll move it to the right changeset at the version 2 of this series.

Hi Mauro,

I have some changes to the gspca.c patch
- the version must stay 2.12.0
- the 'info' may be simplified:

diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index e526aa3..1aa6ae2 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -24,7 +24,6 @@
 #define MODULE_NAME "gspca"
 
 #include <linux/init.h>
-#include <linux/version.h>
 #include <linux/fs.h>
 #include <linux/vmalloc.h>
 #include <linux/sched.h>
@@ -51,11 +50,12 @@
 #error "DEF_NURBS too big"
 #endif
 
+#define DRIVER_VERSION_NUMBER	"2.12.0"
+
 MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("GSPCA USB Camera Driver");
 MODULE_LICENSE("GPL");
-
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 12, 0)
+MODULE_VERSION(DRIVER_VERSION_NUMBER);
 
 #ifdef GSPCA_DEBUG
 int gspca_debug = D_ERR | D_PROBE;
@@ -1291,7 +1291,6 @@ static int vidioc_querycap(struct file *file, void  *priv,
 	}
 	usb_make_path(gspca_dev->dev, (char *) cap->bus_info,
 			sizeof(cap->bus_info));
-	cap->version = DRIVER_VERSION_NUMBER;
 	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE
 			  | V4L2_CAP_STREAMING
 			  | V4L2_CAP_READWRITE;
@@ -2478,10 +2477,7 @@ EXPORT_SYMBOL(gspca_auto_gain_n_exposure);
 /* -- module insert / remove -- */
 static int __init gspca_init(void)
 {
-	info("v%d.%d.%d registered",
-		(DRIVER_VERSION_NUMBER >> 16) & 0xff,
-		(DRIVER_VERSION_NUMBER >> 8) & 0xff,
-		DRIVER_VERSION_NUMBER & 0xff);
+	info("v" DRIVER_VERSION_NUMBER " registered");
 	return 0;
 }
 static void __exit gspca_exit(void)


-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/14] Remove linux/version.h from most drivers/media
  2011-06-27 10:45     ` Jean-Francois Moine
@ 2011-06-28  1:50       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 7+ messages in thread
From: Mauro Carvalho Chehab @ 2011-06-28  1:50 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: Linux Media Mailing List

Em 27-06-2011 07:45, Jean-Francois Moine escreveu:
> On Sun, 26 Jun 2011 15:55:08 -0300
> Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
> 
>> I'll move it to the right changeset at the version 2 of this series.
> 
> Hi Mauro,
> 
> I have some changes to the gspca.c patch
> - the version must stay 2.12.0
> - the 'info' may be simplified:
> 
> diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
> index e526aa3..1aa6ae2 100644
> --- a/drivers/media/video/gspca/gspca.c
> +++ b/drivers/media/video/gspca/gspca.c
> @@ -24,7 +24,6 @@
>  #define MODULE_NAME "gspca"
>  
>  #include <linux/init.h>
> -#include <linux/version.h>
>  #include <linux/fs.h>
>  #include <linux/vmalloc.h>
>  #include <linux/sched.h>
> @@ -51,11 +50,12 @@
>  #error "DEF_NURBS too big"
>  #endif
>  
> +#define DRIVER_VERSION_NUMBER	"2.12.0"
> +
>  MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
>  MODULE_DESCRIPTION("GSPCA USB Camera Driver");
>  MODULE_LICENSE("GPL");
> -
> -#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 12, 0)

Hmm... So, you want to revert this change?

commit 5943ba139182f6a3f27492efecb29b0a514b787f
Author: Jean-François Moine <moinejf@free.fr>
Date:   Tue May 17 04:03:51 2011 -0300

    [media] gspca - main: Version change to 2.13
    
    Signed-off-by: Jean-François Moine <moinejf@free.fr>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index e526aa3..739abd4 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -55,7 +55,7 @@ MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("GSPCA USB Camera Driver");
 MODULE_LICENSE("GPL");
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 12, 0)
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 13, 0)
 
 #ifdef GSPCA_DEBUG
 int gspca_debug = D_ERR | D_PROBE;

If so, I prefer if you do it on a separate patch.


> +MODULE_VERSION(DRIVER_VERSION_NUMBER);
>  
>  #ifdef GSPCA_DEBUG
>  int gspca_debug = D_ERR | D_PROBE;
> @@ -1291,7 +1291,6 @@ static int vidioc_querycap(struct file *file, void  *priv,
>  	}
>  	usb_make_path(gspca_dev->dev, (char *) cap->bus_info,
>  			sizeof(cap->bus_info));
> -	cap->version = DRIVER_VERSION_NUMBER;
>  	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE
>  			  | V4L2_CAP_STREAMING
>  			  | V4L2_CAP_READWRITE;
> @@ -2478,10 +2477,7 @@ EXPORT_SYMBOL(gspca_auto_gain_n_exposure);
>  /* -- module insert / remove -- */
>  static int __init gspca_init(void)
>  {
> -	info("v%d.%d.%d registered",
> -		(DRIVER_VERSION_NUMBER >> 16) & 0xff,
> -		(DRIVER_VERSION_NUMBER >> 8) & 0xff,
> -		DRIVER_VERSION_NUMBER & 0xff);
> +	info("v" DRIVER_VERSION_NUMBER " registered");

Ok, I'll add this change into the patch.

>  	return 0;
>  }
>  static void __exit gspca_exit(void)
> 
> 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-28  1:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-26 16:06 [PATCH 00/14] Remove linux/version.h from most drivers/media Mauro Carvalho Chehab
2011-06-26 16:06 ` Mauro Carvalho Chehab
2011-06-26 17:55 ` Hans Verkuil
2011-06-26 18:14 ` Jean-Francois Moine
2011-06-26 18:55   ` Mauro Carvalho Chehab
2011-06-27 10:45     ` Jean-Francois Moine
2011-06-28  1:50       ` Mauro Carvalho Chehab

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.