Skip to contentSkip to conversation

Remove linux/version.h from most drivers/media

PATCH Superseded Mauro Carvalho Chehab 3 participants 6 messages Jun 26, 2011 – Jun 28, 2011 Media (V4L/DVB)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Remove linux/version.h from most drivers/media

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(-)
Acked-by on the v1 series
#1 lore raw
Quoted 37 lines · 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
Quoted 5 lines

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:

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

Quoted 139 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Mauro Carvalho Chehab
Quoted 1 line · On Sun, 26 Jun 2011 13:06:20 -0300 Mauro Carvalho Chehab <[email protected]>…

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

Hi Mauro,

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

Cheers.

Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#3 lore raw

Em 26-06-2011 15:14, Jean-Francois Moine escreveu:

Quoted 8 lines
Quoted 1 line · On Sun, 26 Jun 2011 13:06:20 -0300 Mauro Carvalho Chehab <[email protected]>…

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.

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

Mauro

#4 lore raw
Quoted 1 line · On Sun, 26 Jun 2011 15:55:08 -0300 Mauro Carvalho Chehab <[email protected]>…

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:

drivers/media/video/gspca/gspca.c +4 -8
index e526aa3..1aa6ae2 100644
@@ -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)
Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#5 lore raw

Em 27-06-2011 07:45, Jean-Francois Moine escreveu:

Quoted 24 lines
Quoted 1 line · On Sun, 26 Jun 2011 15:55:08 -0300 Mauro Carvalho Chehab <[email protected]>…

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:

drivers/media/video/gspca/gspca.c +0 -1
index e526aa3..1aa6ae2 100644
@@ -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>

drivers/media/video/gspca/gspca.c line 58

Quoted 10 lines
drivers/media/video/gspca/gspca.c +2 -2
@@ -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 <[email protected]>
Date:   Tue May 17 04:03:51 2011 -0300

[media] gspca - main: Version change to 2.13

drivers/media/video/gspca/gspca.c +1 -1
index e526aa3..739abd4 100644
@@ -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.

Quoted 13 lines
drivers/media/video/gspca/gspca.c +1 -1
+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;

drivers/media/video/gspca/gspca.c EXPORT_SYMBOL(gspca_auto_gain_n_exposure); · line 2480

Quoted 8 lines
drivers/media/video/gspca/gspca.c +1 -4
@@ -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.

Quoted 5 lines
drivers/media/video/gspca/gspca.c +0 -0
 	return 0;
 }
 static void __exit gspca_exit(void)