diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-28 18:39:32 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-18 11:49:40 -0500 |
commit | 4839c58f034ae41e2dfdd097240a69622cab4c73 (patch) | |
tree | f1cff35db563349cdfe99fa0c5621e185262ff47 /drivers/media/pci/cx88 | |
parent | 2120961f0cd71837e889a84e93dc54b647400c4e (diff) |
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 <isely@pobox.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-video.c | 10 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88.h | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index e3101f04941c..0e0952e60795 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c | |||
@@ -805,8 +805,7 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
805 | 805 | ||
806 | strcpy(cap->driver, "cx88_blackbird"); | 806 | strcpy(cap->driver, "cx88_blackbird"); |
807 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); | 807 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); |
808 | cx88_querycap(file, core, cap); | 808 | return cx88_querycap(file, core, cap); |
809 | return 0; | ||
810 | } | 809 | } |
811 | 810 | ||
812 | static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, | 811 | static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, |
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 7d25ecd4404b..9be682cdb644 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c | |||
@@ -806,8 +806,8 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, | |||
806 | return 0; | 806 | return 0; |
807 | } | 807 | } |
808 | 808 | ||
809 | void cx88_querycap(struct file *file, struct cx88_core *core, | 809 | int cx88_querycap(struct file *file, struct cx88_core *core, |
810 | struct v4l2_capability *cap) | 810 | struct v4l2_capability *cap) |
811 | { | 811 | { |
812 | struct video_device *vdev = video_devdata(file); | 812 | struct video_device *vdev = video_devdata(file); |
813 | 813 | ||
@@ -825,11 +825,14 @@ void cx88_querycap(struct file *file, struct cx88_core *core, | |||
825 | case VFL_TYPE_VBI: | 825 | case VFL_TYPE_VBI: |
826 | cap->device_caps |= V4L2_CAP_VBI_CAPTURE; | 826 | cap->device_caps |= V4L2_CAP_VBI_CAPTURE; |
827 | break; | 827 | break; |
828 | default: | ||
829 | return -EINVAL; | ||
828 | } | 830 | } |
829 | cap->capabilities = cap->device_caps | V4L2_CAP_VIDEO_CAPTURE | | 831 | cap->capabilities = cap->device_caps | V4L2_CAP_VIDEO_CAPTURE | |
830 | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_DEVICE_CAPS; | 832 | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_DEVICE_CAPS; |
831 | if (core->board.radio.type == CX88_RADIO) | 833 | if (core->board.radio.type == CX88_RADIO) |
832 | cap->capabilities |= V4L2_CAP_RADIO; | 834 | cap->capabilities |= V4L2_CAP_RADIO; |
835 | return 0; | ||
833 | } | 836 | } |
834 | EXPORT_SYMBOL(cx88_querycap); | 837 | EXPORT_SYMBOL(cx88_querycap); |
835 | 838 | ||
@@ -841,8 +844,7 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
841 | 844 | ||
842 | strcpy(cap->driver, "cx8800"); | 845 | strcpy(cap->driver, "cx8800"); |
843 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); | 846 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); |
844 | cx88_querycap(file, core, cap); | 847 | return cx88_querycap(file, core, cap); |
845 | return 0; | ||
846 | } | 848 | } |
847 | 849 | ||
848 | static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, | 850 | static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, |
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h index 6777926f20f2..07a33f02fef4 100644 --- a/drivers/media/pci/cx88/cx88.h +++ b/drivers/media/pci/cx88/cx88.h | |||
@@ -734,7 +734,7 @@ int cx8802_start_dma(struct cx8802_dev *dev, | |||
734 | int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i); | 734 | int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i); |
735 | int cx88_set_freq(struct cx88_core *core, const struct v4l2_frequency *f); | 735 | int cx88_set_freq(struct cx88_core *core, const struct v4l2_frequency *f); |
736 | int cx88_video_mux(struct cx88_core *core, unsigned int input); | 736 | int cx88_video_mux(struct cx88_core *core, unsigned int input); |
737 | void cx88_querycap(struct file *file, struct cx88_core *core, | 737 | int cx88_querycap(struct file *file, struct cx88_core *core, |
738 | struct v4l2_capability *cap); | 738 | struct v4l2_capability *cap); |
739 | 739 | ||
740 | #endif | 740 | #endif |