From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
Sylwester Nawrocki <snawrocki@kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCHv3 6/6] media: drop use of MEDIA_API_VERSION
Date: Thu, 27 Jul 2017 17:40:20 +0300 [thread overview]
Message-ID: <37535292.eoyeuJDe2y@avalon> (raw)
In-Reply-To: <20170722113057.45202-7-hverkuil@xs4all.nl>
Hi Hans,
On Saturday 22 Jul 2017 13:30:57 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> 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>
> ---
> drivers/media/media-device.c | 3 +--
> include/uapi/linux/media.h | 5 +++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> index 979e4307d248..3c99294e3ebf 100644
> --- a/drivers/media/media-device.c
> +++ b/drivers/media/media-device.c
> @@ -69,9 +69,8 @@ static int media_device_get_info(struct media_device *dev,
> strlcpy(info->serial, dev->serial, sizeof(info->serial));
> strlcpy(info->bus_info, dev->bus_info, sizeof(info->bus_info));
>
> - info->media_version = MEDIA_API_VERSION;
> + info->media_version = info->driver_version = LINUX_VERSION_CODE;
I'd split this on two lines, I believe it would be clearer. Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> info->hw_revision = dev->hw_revision;
> - info->driver_version = LINUX_VERSION_CODE;
>
> return 0;
> }
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index fac96c64fe51..4865f1e71339 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -30,8 +30,6 @@
> #include <linux/types.h>
> #include <linux/version.h>
>
> -#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
> -
> struct media_device_info {
> char driver[16];
> char model[32];
> @@ -187,6 +185,9 @@ struct media_device_info {
> #define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS
> #define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER
> #define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER
> +
> +/* Obsolete symbol for media_version, no longer used in the kernel */
> +#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
> #endif
>
> /* Entity flags */
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2017-07-27 14:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-22 11:30 [PATCHv3 0/6] media: drop driver_version from media_device Hans Verkuil
2017-07-22 11:30 ` [PATCHv3 1/6] media-device: set driver_version directly Hans Verkuil
2017-07-22 11:30 ` [PATCHv3 2/6] s3c-camif: don't set driver_version Hans Verkuil
2017-07-22 11:30 ` [PATCHv3 3/6] uvc: " Hans Verkuil
2017-07-22 11:30 ` [PATCHv3 4/6] atomisp2: " Hans Verkuil
2017-07-22 11:30 ` [PATCHv3 5/6] media-device: remove driver_version Hans Verkuil
2017-07-22 11:30 ` [PATCHv3 6/6] media: drop use of MEDIA_API_VERSION Hans Verkuil
2017-07-22 13:24 ` Mauro Carvalho Chehab
2017-07-22 13:41 ` Hans Verkuil
2017-07-27 14:40 ` Laurent Pinchart [this message]
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=37535292.eoyeuJDe2y@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=snawrocki@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