From 4839c58f034ae41e2dfdd097240a69622cab4c73 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 Sep 2017 18:39:32 -0400 Subject: media: v4l2-dev: convert VFL_TYPE_* into an enum Using enums makes easier to document, as it can use kernel-doc markups. It also allows cross-referencing, with increases the kAPI readability. Please notice that now cx88_querycap() has to have a default for the VFL type, as there are more types than supported by the driver. Acked-By: Mike Isely Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/cx231xx/cx231xx-video.c | 2 ++ drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 ++ drivers/media/usb/tm6000/tm6000-video.c | 2 ++ 3 files changed, 6 insertions(+) (limited to 'drivers/media/usb') diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 226059fc672b..936542cb059a 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -1756,6 +1756,8 @@ static int cx231xx_v4l2_open(struct file *filp) case VFL_TYPE_RADIO: radio = 1; break; + default: + return -EINVAL; } cx231xx_videodbg("open dev=%s type=%s users=%d\n", diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 4320bda9352d..864830d4c741 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -153,6 +153,8 @@ static int pvr2_querycap(struct file *file, void *priv, struct v4l2_capability * case VFL_TYPE_RADIO: cap->device_caps = V4L2_CAP_RADIO; break; + default: + return -EINVAL; } cap->device_caps |= V4L2_CAP_TUNER | V4L2_CAP_READWRITE; return 0; diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index a95ea629b203..df040558997e 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -1313,6 +1313,8 @@ static int __tm6000_open(struct file *file) case VFL_TYPE_RADIO: radio = 1; break; + default: + return -EINVAL; } /* If more than one user, mutex should be added */ -- cgit v1.2.3