diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2022-01-22 16:23:18 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-04-24 10:07:08 +0300 |
commit | f2d8b6917f3bcfb3190eb80567fea71a9b59dbd3 (patch) | |
tree | e3909757b20eed89588b2be2ba593d0db4901a16 /drivers/media/pci | |
parent | cef699749f3789add5ecaf0a2f73a659cae1c7ae (diff) | |
download | linux-f2d8b6917f3bcfb3190eb80567fea71a9b59dbd3.tar.xz |
media: v4l: ioctl: Set bus_info in v4l_querycap()
The bus_info field is set by most drivers based on the type of the device
bus as well as the name of the device. Do this in v4l_querycap() so
drivers don't need to. This keeps compatibility with non-default and silly
bus_info.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/cx18/cx18-ioctl.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-video.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/dt3155/dt3155.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-ioctl.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/meye/meye.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-video.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/saa7164/saa7164-encoder.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/saa7164/saa7164-vbi.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/solo6x10/solo6x10-v4l2.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/sta2x11/sta2x11_vip.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/tw5864/tw5864-video.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/tw68/tw68-video.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/tw686x/tw686x-video.c | 2 |
17 files changed, 0 insertions, 35 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 5ca3d0cc653a..d40b537f4e98 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -2435,8 +2435,6 @@ static int bttv_querycap(struct file *file, void *priv, strscpy(cap->driver, "bttv", sizeof(cap->driver)); strscpy(cap->card, btv->video_dev.name, sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "PCI:%s", pci_name(btv->c.pci)); cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS; if (no_overlay <= 0) diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index ce3f0141f94e..c8ba7841c720 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -389,8 +389,6 @@ static int cx18_querycap(struct file *file, void *fh, strscpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver)); strscpy(vcap->card, cx->card_name, sizeof(vcap->card)); - snprintf(vcap->bus_info, sizeof(vcap->bus_info), - "PCI:%s", pci_name(cx->pci_dev)); vcap->capabilities = cx->v4l2_cap | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index d5da3bd5695d..c1b41a9283c1 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c @@ -796,7 +796,6 @@ static int vidioc_querycap(struct file *file, void *priv, struct cx88_core *core = dev->core; strscpy(cap->driver, "cx88_blackbird", sizeof(cap->driver)); - sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); return cx88_querycap(file, core, cap); } diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index c17ad9f7d822..d3729be89252 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -808,7 +808,6 @@ static int vidioc_querycap(struct file *file, void *priv, struct cx88_core *core = dev->core; strscpy(cap->driver, "cx8800", sizeof(cap->driver)); - sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); return cx88_querycap(file, core, cap); } diff --git a/drivers/media/pci/dt3155/dt3155.c b/drivers/media/pci/dt3155/dt3155.c index 961f844de99c..548156b199cc 100644 --- a/drivers/media/pci/dt3155/dt3155.c +++ b/drivers/media/pci/dt3155/dt3155.c @@ -292,11 +292,8 @@ static const struct v4l2_file_operations dt3155_fops = { static int dt3155_querycap(struct file *filp, void *p, struct v4l2_capability *cap) { - struct dt3155_priv *pd = video_drvdata(filp); - strscpy(cap->driver, DT3155_NAME, sizeof(cap->driver)); strscpy(cap->card, DT3155_NAME " frame grabber", sizeof(cap->card)); - sprintf(cap->bus_info, "PCI:%s", pci_name(pd->pdev)); return 0; } diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c index b15fac775e14..0975a069bd38 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c @@ -1046,12 +1046,8 @@ static const struct vb2_ops cio2_vb2_ops = { static int cio2_v4l2_querycap(struct file *file, void *fh, struct v4l2_capability *cap) { - struct cio2_device *cio2 = video_drvdata(file); - strscpy(cap->driver, CIO2_NAME, sizeof(cap->driver)); strscpy(cap->card, CIO2_DEVICE_NAME, sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "PCI:%s", pci_name(cio2->pci_dev)); return 0; } diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index fee460e2ca86..7947dcd615e8 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -732,7 +732,6 @@ static int ivtv_querycap(struct file *file, void *fh, struct v4l2_capability *vc strscpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver)); strscpy(vcap->card, itv->card_name, sizeof(vcap->card)); - snprintf(vcap->bus_info, sizeof(vcap->bus_info), "PCI:%s", pci_name(itv->pdev)); vcap->capabilities = itv->v4l2_cap | V4L2_CAP_DEVICE_CAPS; return 0; } diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 8944e4bd4638..5d87efd9b95c 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c @@ -1012,7 +1012,6 @@ static int vidioc_querycap(struct file *file, void *fh, { strscpy(cap->driver, "meye", sizeof(cap->driver)); strscpy(cap->card, "meye", sizeof(cap->card)); - sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev)); return 0; } diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 48543ad3d595..98c258a1cd01 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -1475,7 +1475,6 @@ int saa7134_querycap(struct file *file, void *priv, strscpy(cap->driver, "saa7134", sizeof(cap->driver)); strscpy(cap->card, saa7134_boards[dev->board].name, sizeof(cap->card)); - sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); cap->capabilities = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_RADIO | V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_DEVICE_CAPS; diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c index 1d1d32e043f1..c1b6a0596801 100644 --- a/drivers/media/pci/saa7164/saa7164-encoder.c +++ b/drivers/media/pci/saa7164/saa7164-encoder.c @@ -490,7 +490,6 @@ static int vidioc_querycap(struct file *file, void *priv, strscpy(cap->driver, dev->name, sizeof(cap->driver)); strscpy(cap->card, saa7164_boards[dev->board].name, sizeof(cap->card)); - sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_DEVICE_CAPS; diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c index cb2e09f0841d..a6738baab688 100644 --- a/drivers/media/pci/saa7164/saa7164-vbi.c +++ b/drivers/media/pci/saa7164/saa7164-vbi.c @@ -201,7 +201,6 @@ static int vidioc_querycap(struct file *file, void *priv, strscpy(cap->driver, dev->name, sizeof(cap->driver)); strscpy(cap->card, saa7164_boards[dev->board].name, sizeof(cap->card)); - sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_DEVICE_CAPS; diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c index 7766cadb73ea..80d20e2a2099 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c @@ -764,13 +764,10 @@ static int solo_enc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { struct solo_enc_dev *solo_enc = video_drvdata(file); - struct solo_dev *solo_dev = solo_enc->solo_dev; strscpy(cap->driver, SOLO6X10_NAME, sizeof(cap->driver)); snprintf(cap->card, sizeof(cap->card), "Softlogic 6x10 Enc %d", solo_enc->ch); - snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", - pci_name(solo_dev->pdev)); return 0; } diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2.c b/drivers/media/pci/solo6x10/solo6x10-v4l2.c index 24ef0c446bef..e18cc41fca83 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2.c @@ -372,12 +372,8 @@ static const struct vb2_ops solo_video_qops = { static int solo_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct solo_dev *solo_dev = video_drvdata(file); - strscpy(cap->driver, SOLO6X10_NAME, sizeof(cap->driver)); strscpy(cap->card, "Softlogic 6x10", sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", - pci_name(solo_dev->pdev)); return 0; } diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index 524912f20d9f..8535e49a4c4f 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -401,12 +401,8 @@ static const struct v4l2_file_operations vip_fops = { static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct sta2x11_vip *vip = video_drvdata(file); - strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); strscpy(cap->card, KBUILD_MODNAME, sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", - pci_name(vip->pdev)); return 0; } diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c index 9131265c2b87..197ed8978102 100644 --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -604,7 +604,6 @@ static int tw5864_querycap(struct file *file, void *priv, strscpy(cap->driver, "tw5864", sizeof(cap->driver)); snprintf(cap->card, sizeof(cap->card), "TW5864 Encoder %d", input->nr); - sprintf(cap->bus_info, "PCI:%s", pci_name(input->root->pci)); return 0; } diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c index fe94944d0531..0cbc5b038073 100644 --- a/drivers/media/pci/tw68/tw68-video.c +++ b/drivers/media/pci/tw68/tw68-video.c @@ -712,12 +712,9 @@ static int tw68_s_input(struct file *file, void *priv, unsigned int i) static int tw68_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct tw68_dev *dev = video_drvdata(file); - strscpy(cap->driver, "tw68", sizeof(cap->driver)); strscpy(cap->card, "Techwell Capture Card", sizeof(cap->card)); - sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); return 0; } diff --git a/drivers/media/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c index b227e9e78ebd..6344a479119f 100644 --- a/drivers/media/pci/tw686x/tw686x-video.c +++ b/drivers/media/pci/tw686x/tw686x-video.c @@ -762,8 +762,6 @@ static int tw686x_querycap(struct file *file, void *priv, strscpy(cap->driver, "tw686x", sizeof(cap->driver)); strscpy(cap->card, dev->name, sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "PCI:%s", pci_name(dev->pci_dev)); return 0; } |