public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: unlisted-recipients:; (no To-header on input)@casper.infradead.org
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Laurent Pincart <laurent.pinchart@ideasonboard.com>,
	Mike Isely <isely@isely.net>
Subject: [PATCH 00/14] Remove linux/version.h from most drivers/media
Date: Sun, 26 Jun 2011 13:06:20 -0300	[thread overview]
Message-ID: <20110626130620.4b5ed679@pedra> (raw)

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(-)


             reply	other threads:[~2011-06-26 16:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-26 16:06 Mauro Carvalho Chehab [this message]
2011-06-26 17:55 ` [PATCH 00/14] Remove linux/version.h from most drivers/media 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

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=20110626130620.4b5ed679@pedra \
    --to=mchehab@redhat.com \
    --cc=isely@isely.net \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --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