Commit f1d00607 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Mauro Carvalho Chehab

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: default avatarGustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6d2eaece
...@@ -909,18 +909,15 @@ static int hackrf_querycap(struct file *file, void *fh, ...@@ -909,18 +909,15 @@ static int hackrf_querycap(struct file *file, void *fh,
dev_dbg(&intf->dev, "\n"); dev_dbg(&intf->dev, "\n");
cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
if (vdev->vfl_dir == VFL_DIR_RX) if (vdev->vfl_dir == VFL_DIR_RX)
cap->device_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER | cap->device_caps |= V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER;
V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
else else
cap->device_caps = V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR | cap->device_caps |= V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR;
V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
cap->capabilities = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER | cap->capabilities = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER |
V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR | V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR |
V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | V4L2_CAP_DEVICE_CAPS | cap->device_caps;
V4L2_CAP_DEVICE_CAPS;
strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
strlcpy(cap->card, dev->rx_vdev.name, sizeof(cap->card)); strlcpy(cap->card, dev->rx_vdev.name, sizeof(cap->card));
usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment