media: v4l: ioctl: Set bus_info in v4l_querycap()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Sat, 22 Jan 2022 13:23:18 +0000 (13:23 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:07:08 +0000 (08:07 +0100)
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>
40 files changed:
drivers/media/common/saa7146/saa7146_video.c
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/cx18/cx18-ioctl.c
drivers/media/pci/cx88/cx88-blackbird.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/dt3155/dt3155.c
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/pci/meye/meye.c
drivers/media/pci/saa7134/saa7134-video.c
drivers/media/pci/saa7164/saa7164-encoder.c
drivers/media/pci/saa7164/saa7164-vbi.c
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
drivers/media/pci/solo6x10/solo6x10-v4l2.c
drivers/media/pci/sta2x11/sta2x11_vip.c
drivers/media/pci/tw5864/tw5864-video.c
drivers/media/pci/tw68/tw68-video.c
drivers/media/pci/tw686x/tw686x-video.c
drivers/media/platform/allegro-dvt/allegro-core.c
drivers/media/platform/marvell/cafe-driver.c
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
drivers/media/platform/qcom/camss/camss-video.c
drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
drivers/media/platform/renesas/rcar_jpu.c
drivers/media/platform/renesas/vsp1/vsp1_histo.c
drivers/media/platform/renesas/vsp1/vsp1_video.c
drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c
drivers/media/platform/samsung/exynos4-is/common.c
drivers/media/platform/samsung/exynos4-is/fimc-lite.c
drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c
drivers/media/platform/ti/cal/cal-video.c
drivers/media/platform/ti/davinci/vpbe_display.c
drivers/media/platform/ti/davinci/vpif_capture.c
drivers/media/platform/ti/davinci/vpif_display.c
drivers/media/radio/radio-maxiradio.c
drivers/media/v4l2-core/v4l2-ioctl.c

index 66215d9106a42dd2f392bfb5048451972cac35fa..2296765079a41d503cf77e94f2a4ded828924147 100644 (file)
@@ -443,7 +443,6 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *
 
        strscpy((char *)cap->driver, "saa7146 v4l2", sizeof(cap->driver));
        strscpy((char *)cap->card, dev->ext->name, sizeof(cap->card));
-       sprintf((char *)cap->bus_info, "PCI:%s", pci_name(dev->pci));
        cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY |
                            V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
                            V4L2_CAP_DEVICE_CAPS;
index 5ca3d0cc653a890ce75b5839a5d91c76dfaf38ad..d40b537f4e98be383fa4ebb513821ec9cea96365 100644 (file)
@@ -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)
index ce3f0141f94efc6babae1d60f129fa4a9ac45655..c8ba7841c72088ea54a632cbc03f54ab4d2186fa 100644 (file)
@@ -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;
 }
index d5da3bd5695d734b6673be2311641e77621cd6f4..c1b41a9283c1d89298d9237ce29cab8757752e9e 100644 (file)
@@ -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);
 }
 
index c17ad9f7d822b4e20f2bb4935d9f9c403cabf0d9..d3729be8925294e1b611509b5e884b770ec04cf1 100644 (file)
@@ -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);
 }
 
index 961f844de99c04efc4039d2af7baf83bae1e49ac..548156b199cc1abc2d0719d6d80445a9f1877827 100644 (file)
@@ -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;
 }
 
index b15fac775e147f689be8887a2ea492be6029876e..0975a069bd3844bb0d7e89e8308971fdd20135bb 100644 (file)
@@ -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;
 }
index fee460e2ca8636e4c9cc086b34e5b7809fd965e1..7947dcd615e882da5240ed6b10dde8449036d019 100644 (file)
@@ -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;
 }
index 8944e4bd4638261904f972fc719cf845de4e2187..5d87efd9b95c6862a190649c12d7232d61b61888 100644 (file)
@@ -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;
 }
 
index 48543ad3d5951326f837059f940af888685c16fb..98c258a1cd0129b0ba3cbe239236ea79e58c3edb 100644 (file)
@@ -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;
index 1d1d32e043f164710cc11bafb7f35f82e30111f6..c1b6a0596801c0c86c6dfbaafa1ec915ac74db19 100644 (file)
@@ -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;
index cb2e09f0841d9645f55db5d392fe96b39f602bcf..a6738baab6880e3bd87d8c1146f9d0c5c5401b76 100644 (file)
@@ -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;
index 7766cadb73ea1e0e5b26b84da3b5197256f57cdc..80d20e2a2099b4fc81552b9d15a29034ada191e2 100644 (file)
@@ -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;
 }
 
index 24ef0c446bef10346144cf6822e00b4851d8d90d..e18cc41fca83b2b5293dc4d654c96a5ee86a6993 100644 (file)
@@ -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;
 }
 
index 524912f20d9f2beb0bd47551e41f1ff9fadcdac7..8535e49a4c4f9ba852db4889e7984132083ae285 100644 (file)
@@ -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;
 }
 
index 9131265c2b87429794bbb0a289bf36c86204cc5f..197ed8978102660c7e3215dac1fe632e02d2ce0e 100644 (file)
@@ -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;
 }
 
index fe94944d05317992180c252a83c668db496a6ddf..0cbc5b038073bc3b052d1acf6ba4d3220c99ceeb 100644 (file)
@@ -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;
 }
 
index b227e9e78ebd0970ad9b53ae8b83bb8054e210b3..6344a479119fe827f171fa419509ef00b384500e 100644 (file)
@@ -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;
 }
 
index 4a3d06c70e34879c82efd8e291a0d3340b182096..2423714afcb9f28d1dfde5ef7b2d8be0ed933262 100644 (file)
@@ -3249,13 +3249,8 @@ static int allegro_release(struct file *file)
 static int allegro_querycap(struct file *file, void *fh,
                            struct v4l2_capability *cap)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct allegro_dev *dev = video_get_drvdata(vdev);
-
        strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
        strscpy(cap->card, "Allegro DVT Video Encoder", sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(&dev->plat_dev->dev));
 
        return 0;
 }
index 03dcf8bf705e844fa4cde6f75457f08b81a7ae2f..ae97ce4ead9886149dd585d71deb599cef323cc6 100644 (file)
@@ -497,7 +497,6 @@ static int cafe_pci_probe(struct pci_dev *pdev,
        mcam->plat_power_up = cafe_ctlr_power_up;
        mcam->plat_power_down = cafe_ctlr_power_down;
        mcam->dev = &pdev->dev;
-       snprintf(mcam->bus_info, sizeof(mcam->bus_info), "PCI:%s", pci_name(pdev));
        /*
         * Vmalloc mode for buffers is traditional with this driver.
         * We *might* be able to run DMA_contig, especially on a system
index ab5485dfc20c87573ee8c7fe0aa762986b6466f1..bc5b0a0168ec0012b04ae460ac6482f16d20b84d 100644 (file)
@@ -137,8 +137,6 @@ static int mtk_jpeg_querycap(struct file *file, void *priv,
 
        strscpy(cap->driver, jpeg->variant->dev_name, sizeof(cap->driver));
        strscpy(cap->card, jpeg->variant->dev_name, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(jpeg->dev));
 
        return 0;
 }
index d1ec1f4b506b8220daac5b31aed1c6984107042e..c9ca7577140c14926455fe0871cd096d460020b2 100644 (file)
@@ -1569,12 +1569,8 @@ free:
 static int mxc_jpeg_querycap(struct file *file, void *priv,
                             struct v4l2_capability *cap)
 {
-       struct mxc_jpeg_dev *mxc_jpeg = video_drvdata(file);
-
        strscpy(cap->driver, MXC_JPEG_NAME " codec", sizeof(cap->driver));
        strscpy(cap->card, MXC_JPEG_NAME " codec", sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(mxc_jpeg->dev));
        cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
index 5dc1ddbe6d658e2b5e132bd78d8cbd271f6eb0b0..307bb1dc45898387856fd354c93040c9f7776cfc 100644 (file)
@@ -576,12 +576,8 @@ static const struct vb2_ops msm_video_vb2_q_ops = {
 static int video_querycap(struct file *file, void *fh,
                          struct v4l2_capability *cap)
 {
-       struct camss_video *video = video_drvdata(file);
-
        strscpy(cap->driver, "qcom-camss", sizeof(cap->driver));
        strscpy(cap->card, "Qualcomm Camera Subsystem", sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(video->camss->dev));
 
        return 0;
 }
index 2e60b9fce03b05e061f32436bdc17c6881486868..287fbf2e52b3edc1f40ea4a66fdbdcb321e713c8 100644 (file)
@@ -307,12 +307,8 @@ done:
 static int rvin_querycap(struct file *file, void *priv,
                         struct v4l2_capability *cap)
 {
-       struct rvin_dev *vin = video_drvdata(file);
-
        strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
        strscpy(cap->card, "R_Car_VIN", sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(vin->dev));
        return 0;
 }
 
index 293beba131e2f897a8e8d03846a475c287e2c6a5..2f4377cfbb420b8cd980fdbec4d20d969f2b7694 100644 (file)
@@ -670,8 +670,6 @@ static int jpu_querycap(struct file *file, void *priv,
                strscpy(cap->card, DRV_NAME " decoder", sizeof(cap->card));
 
        strscpy(cap->driver, DRV_NAME, sizeof(cap->driver));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(ctx->jpu->dev));
        memset(cap->reserved, 0, sizeof(cap->reserved));
 
        return 0;
index 5e5013d2cd2ad87f7853f437325c713a55d82d25..f22449dd654cb51cfcab134755b52fe07bc2fa31 100644 (file)
@@ -434,8 +434,6 @@ static int histo_v4l2_querycap(struct file *file, void *fh,
 
        strscpy(cap->driver, "vsp1", sizeof(cap->driver));
        strscpy(cap->card, histo->video.name, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(histo->entity.vsp1->dev));
 
        return 0;
 }
index 044eb577882074c2bd71e437ed7ab7b1bc862bf8..497f352e9f8c65e4a0f3d0e06be761e1e0925fdd 100644 (file)
@@ -959,8 +959,6 @@ vsp1_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 
        strscpy(cap->driver, "vsp1", sizeof(cap->driver));
        strscpy(cap->card, video->video.name, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(video->vsp1->dev));
 
        return 0;
 }
index f1cf847d1cc2d9fd2f2a75018b8059fb39c79096..b7854ce5fb8e34f51b70f7392caf2ccb1cf0d7ba 100644 (file)
@@ -285,13 +285,8 @@ static const struct vb2_ops gsc_m2m_qops = {
 static int gsc_m2m_querycap(struct file *file, void *fh,
                           struct v4l2_capability *cap)
 {
-       struct gsc_ctx *ctx = fh_to_ctx(fh);
-       struct gsc_dev *gsc = ctx->gsc_dev;
-
        strscpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
        strscpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(&gsc->pdev->dev));
        return 0;
 }
 
index 023f624d29d58491d41c8f7fef42fdb2f4ef25ac..26ee2388edfd4c54ce3dc5cb4c76db280fbf458d 100644 (file)
@@ -41,8 +41,6 @@ void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap)
 {
        strscpy(cap->driver, dev->driver->name, sizeof(cap->driver));
        strscpy(cap->card, dev->driver->name, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info),
-                               "platform:%s", dev_name(dev));
 }
 EXPORT_SYMBOL(__fimc_vidioc_querycap);
 
index 2e8f476efc5cfd6a726a856a74d07576c0b5bd7f..1a396b7cd9a9cf476ade1cb24a372acfa72c384a 100644 (file)
@@ -646,12 +646,8 @@ static void fimc_lite_try_compose(struct fimc_lite *fimc, struct v4l2_rect *r)
 static int fimc_lite_querycap(struct file *file, void *priv,
                                        struct v4l2_capability *cap)
 {
-       struct fimc_lite *fimc = video_drvdata(file);
-
        strscpy(cap->driver, FIMC_LITE_DRV_NAME, sizeof(cap->driver));
        strscpy(cap->card, FIMC_LITE_DRV_NAME, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                                       dev_name(&fimc->pdev->dev));
        return 0;
 }
 
index 5479bc8d474d6dcb6c1afe2d4773917d9cdfb170..456287186ad8e8a7793f5fbf9c4a9c0e9af99299 100644 (file)
@@ -1257,8 +1257,6 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
                strscpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
                        sizeof(cap->card));
        }
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(ctx->jpeg->dev));
        return 0;
 }
 
index 4b89df8bfd187887c849d08af37595fb36b1661c..268ffe4da53c0794722ec07b0572790617f316a1 100644 (file)
@@ -288,8 +288,6 @@ static int vidioc_querycap(struct file *file, void *priv,
 
        strscpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
        strscpy(cap->card, dev->vfd_dec->name, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(&dev->plat_dev->dev));
        return 0;
 }
 
index a8877d805b29163ed0c82feadfc05be020fb6137..b65e506665af7a134bcc6018790ee6413641c451 100644 (file)
@@ -1309,8 +1309,6 @@ static int vidioc_querycap(struct file *file, void *priv,
 
        strscpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
        strscpy(cap->card, dev->vfd_enc->name, sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(&dev->plat_dev->dev));
        return 0;
 }
 
index 3872027ed2faf67471daa88f4c839faca92460d2..48702134ccc55e41faa84d80f257997099f4a38b 100644 (file)
@@ -53,12 +53,8 @@ const struct sun4i_csi_format *sun4i_csi_find_format(const u32 *fourcc,
 static int sun4i_csi_querycap(struct file *file, void *priv,
                              struct v4l2_capability *cap)
 {
-       struct sun4i_csi *csi = video_drvdata(file);
-
        strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
        strscpy(cap->card, "sun4i-csi", sizeof(cap->card));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(csi->dev));
 
        return 0;
 }
index 3e936a2ca36c67c094030ac92cbadce5781839e2..07ae1a34e6b0bbbed5ec90355e79a517d574594f 100644 (file)
@@ -47,13 +47,9 @@ static char *fourcc_to_str(u32 fmt)
 static int cal_querycap(struct file *file, void *priv,
                        struct v4l2_capability *cap)
 {
-       struct cal_ctx *ctx = video_drvdata(file);
-
        strscpy(cap->driver, CAL_MODULE_NAME, sizeof(cap->driver));
        strscpy(cap->card, CAL_MODULE_NAME, sizeof(cap->card));
 
-       snprintf(cap->bus_info, sizeof(cap->bus_info),
-                "platform:%s", dev_name(ctx->cal->dev));
        return 0;
 }
 
index bf3c3e76b9213102629369988855a9322a2fc60d..9ea70817538e7940447c2152b92cdf9c3dda6925 100644 (file)
@@ -630,8 +630,6 @@ static int vpbe_display_querycap(struct file *file, void  *priv,
 
        snprintf(cap->driver, sizeof(cap->driver), "%s",
                dev_name(vpbe_dev->pdev));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(vpbe_dev->pdev));
        strscpy(cap->card, vpbe_dev->cfg->module_name, sizeof(cap->card));
 
        return 0;
index bf76c5c837439bbf0475efd0e30df7f6af0b13b5..b91eec899eb5c29512b7289a84211d386c6c004d 100644 (file)
@@ -1067,8 +1067,6 @@ static int vpif_querycap(struct file *file, void  *priv,
        struct vpif_capture_config *config = vpif_dev->platform_data;
 
        strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(vpif_dev));
        strscpy(cap->card, config->card_name, sizeof(cap->card));
 
        return 0;
index fca148b6647198add5d639fd30f018a74de13229..4b7c896ad349c6da190c0f73636ee28bd4057704 100644 (file)
@@ -585,8 +585,6 @@ static int vpif_querycap(struct file *file, void  *priv,
        struct vpif_display_config *config = vpif_dev->platform_data;
 
        strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
-       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
-                dev_name(vpif_dev));
        strscpy(cap->card, config->card_name, sizeof(cap->card));
 
        return 0;
index de107e2cbcd696e9661d07d53a093461d20edf84..1a5dbae24ef458202a34528e7197e544a65c5796 100644 (file)
@@ -144,8 +144,6 @@ static int maxiradio_probe(struct pci_dev *pdev,
        dev->tea.v4l2_dev = v4l2_dev;
        dev->tea.radio_nr = radio_nr;
        strscpy(dev->tea.card, "Maxi Radio FM2000", sizeof(dev->tea.card));
-       snprintf(dev->tea.bus_info, sizeof(dev->tea.bus_info),
-                       "PCI:%s", pci_name(pdev));
 
        retval = -ENODEV;
 
index 96e307fe3aab2557df44f154649b64d630826bbd..db5947fbd9a925b10a55a63609c61df67050961c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/videodev2.h>
 
+#include <media/media-device.h> /* for media_set_bus_info() */
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
 #include <media/v4l2-ctrls.h>
@@ -1052,6 +1053,9 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops,
        cap->device_caps = vfd->device_caps;
        cap->capabilities = vfd->device_caps | V4L2_CAP_DEVICE_CAPS;
 
+       media_set_bus_info(cap->bus_info, sizeof(cap->bus_info),
+                          vfd->dev_parent);
+
        ret = ops->vidioc_querycap(file, fh, cap);
 
        /*