diff options
author | Gustavo Padovan <gustavo.padovan@collabora.com> | 2018-05-04 16:05:59 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-11 11:25:23 -0400 |
commit | f1d00607afd69354a3cc29ef13e95ccb3fef8a77 (patch) | |
tree | 48fbb2ba2f2614213f891df5fada468a07db01a6 | |
parent | 6d2eaece20ffe783cdbcedd7ef2d6ae51d846d33 (diff) | |
download | linux-f1d00607afd69354a3cc29ef13e95ccb3fef8a77.tar.gz linux-f1d00607afd69354a3cc29ef13e95ccb3fef8a77.tar.bz2 linux-f1d00607afd69354a3cc29ef13e95ccb3fef8a77.zip |
media: hackrf: group device capabilities
Instead of putting V4L2_CAP_STREAMING and V4L2_CAP_READWRITE
everywhere, set device_caps earlier with these values.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/usb/hackrf/hackrf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 7eb53517a82f..6d692fb3e8dd 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -909,18 +909,15 @@ static int hackrf_querycap(struct file *file, void *fh, dev_dbg(&intf->dev, "\n"); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; if (vdev->vfl_dir == VFL_DIR_RX) - cap->device_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER | - V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; - + cap->device_caps |= V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER; else - cap->device_caps = V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR | - V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + cap->device_caps |= V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR; cap->capabilities = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER | V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR | - V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | - V4L2_CAP_DEVICE_CAPS; + V4L2_CAP_DEVICE_CAPS | cap->device_caps; strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); strlcpy(cap->card, dev->rx_vdev.name, sizeof(cap->card)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); |