Commit f122d9a8 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] radio-miropcm20: fix querycap

Don't set version (done by the v4l2 core), fill in bus_info, set correct
driver name and add device_caps support.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c9114031
...@@ -79,11 +79,13 @@ static const struct v4l2_file_operations pcm20_fops = { ...@@ -79,11 +79,13 @@ static const struct v4l2_file_operations pcm20_fops = {
static int vidioc_querycap(struct file *file, void *priv, static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *v) struct v4l2_capability *v)
{ {
struct pcm20 *dev = video_drvdata(file);
strlcpy(v->driver, "Miro PCM20", sizeof(v->driver)); strlcpy(v->driver, "Miro PCM20", sizeof(v->driver));
strlcpy(v->card, "Miro PCM20", sizeof(v->card)); strlcpy(v->card, "Miro PCM20", sizeof(v->card));
strlcpy(v->bus_info, "ISA", sizeof(v->bus_info)); snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name);
v->version = 0x1; v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0; return 0;
} }
...@@ -229,7 +231,7 @@ static int __init pcm20_init(void) ...@@ -229,7 +231,7 @@ static int __init pcm20_init(void)
"you must load the snd-miro driver first!\n"); "you must load the snd-miro driver first!\n");
return -ENODEV; return -ENODEV;
} }
strlcpy(v4l2_dev->name, "miropcm20", sizeof(v4l2_dev->name)); strlcpy(v4l2_dev->name, "radio-miropcm20", sizeof(v4l2_dev->name));
mutex_init(&dev->lock); mutex_init(&dev->lock);
res = v4l2_device_register(NULL, v4l2_dev); res = v4l2_device_register(NULL, v4l2_dev);
......
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