Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: drop use of MEDIA_API_VERSION

Set media_version to LINUX_VERSION_CODE, just as we did for
driver_version.

Nobody ever rememebers to update the version number, but
LINUX_VERSION_CODE will always be updated.

Move the MEDIA_API_VERSION define to the ifndef __KERNEL__ section of the
media.h header. That way kernelspace can't accidentally start to use
it again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
6c2c188f 2bd86823

+5 -4
+2 -2
drivers/media/media-device.c
··· 69 69 strlcpy(info->serial, dev->serial, sizeof(info->serial)); 70 70 strlcpy(info->bus_info, dev->bus_info, sizeof(info->bus_info)); 71 71 72 - info->media_version = MEDIA_API_VERSION; 72 + info->media_version = LINUX_VERSION_CODE; 73 + info->driver_version = info->media_version; 73 74 info->hw_revision = dev->hw_revision; 74 - info->driver_version = LINUX_VERSION_CODE; 75 75 76 76 return 0; 77 77 }
+3 -2
include/uapi/linux/media.h
··· 30 30 #include <linux/types.h> 31 31 #include <linux/version.h> 32 32 33 - #define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0) 34 - 35 33 struct media_device_info { 36 34 char driver[16]; 37 35 char model[32]; ··· 185 187 #define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS 186 188 #define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER 187 189 #define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER 190 + 191 + /* Obsolete symbol for media_version, no longer used in the kernel */ 192 + #define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0) 188 193 #endif 189 194 190 195 /* Entity flags */