Skip to contentSkip to conversation

saa7164: fix querycap warning

PATCH New Hans Verkuil 1 participant 1 message Mar 27, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 saa7164: fix querycap warning

Hi Steve,

Please use this patch to fix the querycap warning in saa7164, this is the correct fix. In the past drivers were all over the place in how they filled in the capabilities field: it was either just the caps for the device node, or the caps for the full driver capabilities. Now capabilities reports the full driver caps and device_caps that of just the device node. Best of both worlds. The warning was added to warn about drivers that didn't set device_caps correctly, and it is a mystery to me how I missed saa7164. Anyway, the warning did its job.

Regards,

Hans

------

Fix the VIDIOC_QUERYCAP warning due to the missing device_caps. Don't fill in the version field, the V4L2 core will do that for you.

drivers/media/pci/saa7164/saa7164-encoder.c +6 -5
index 9266965..7a0a651 100644
@@ -721,13 +721,14 @@ static int vidioc_querycap(struct file *file, void  *priv,
 		sizeof(cap->card));
 	sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
 
-	cap->capabilities =
+	cap->device_caps =
 		V4L2_CAP_VIDEO_CAPTURE |
-		V4L2_CAP_READWRITE     |
-		0;
+		V4L2_CAP_READWRITE |
+		V4L2_CAP_TUNER;
 
-	cap->capabilities |= V4L2_CAP_TUNER;
-	cap->version = 0;
+	cap->capabilities = cap->device_caps |
+		V4L2_CAP_VBI_CAPTURE |
+		V4L2_CAP_DEVICE_CAPS;
 
 	return 0;
 }
drivers/media/pci/saa7164/saa7164-vbi.c +6 -5
index 6e025fe..06117e6 100644
@@ -660,13 +660,14 @@ static int vidioc_querycap(struct file *file, void  *priv,
 		sizeof(cap->card));
 	sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
 
-	cap->capabilities =
+	cap->device_caps =
 		V4L2_CAP_VBI_CAPTURE |
-		V4L2_CAP_READWRITE     |
-		0;
+		V4L2_CAP_READWRITE |
+		V4L2_CAP_TUNER;
 
-	cap->capabilities |= V4L2_CAP_TUNER;
-	cap->version = 0;
+	cap->capabilities = cap->device_caps |
+		V4L2_CAP_VIDEO_CAPTURE |
+		V4L2_CAP_DEVICE_CAPS;
 
 	return 0;
 }