diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-22 11:42:04 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-23 07:18:45 -0300 |
commit | 41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa (patch) | |
tree | 32743771d16d1b18d305600dc66d0f4828fecbde /drivers/media/v4l2-core/v4l2-mc.c | |
parent | 2ddf22eec4b88ab0d4235a140db8243eaaab5128 (diff) | |
download | linux-stable-41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa.tar.gz linux-stable-41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa.tar.bz2 linux-stable-41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa.zip |
[media] media-device: move PCI/USB helper functions from v4l2-mc
Those ancillary functions could be called even when compiled
without V4L2 support, as warned by ktest build robot:
All errors (new ones prefixed by >>):
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined!
Also, there's nothing there that are specific to V4L2. So, move
those ancillary functions to MC core.
No functional changes. Just function rename.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-mc.c')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-mc.c | 76 |
1 files changed, 1 insertions, 75 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c index 64eefb9ffb7e..4a1efa827fe2 100644 --- a/drivers/media/v4l2-core/v4l2-mc.c +++ b/drivers/media/v4l2-core/v4l2-mc.c @@ -1,7 +1,7 @@ /* * Media Controller ancillary functions * - * (c) 2016 Mauro Carvalho Chehab <mchehab@osg.samsung.com> + * Copyright (c) 2016 Mauro Carvalho Chehab <mchehab@osg.samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,83 +15,9 @@ */ #include <linux/module.h> -#include <linux/pci.h> -#include <linux/usb.h> #include <media/media-entity.h> #include <media/v4l2-mc.h> - -struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev, - const char *name) -{ -#ifdef CONFIG_PCI - struct media_device *mdev; - - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); - if (!mdev) - return NULL; - - mdev->dev = &pci_dev->dev; - - if (name) - strlcpy(mdev->model, name, sizeof(mdev->model)); - else - strlcpy(mdev->model, pci_name(pci_dev), sizeof(mdev->model)); - - sprintf(mdev->bus_info, "PCI:%s", pci_name(pci_dev)); - - mdev->hw_revision = (pci_dev->subsystem_vendor << 16) - | pci_dev->subsystem_device; - - mdev->driver_version = LINUX_VERSION_CODE; - - media_device_init(mdev); - - return mdev; -#else - return NULL; -#endif -} -EXPORT_SYMBOL_GPL(v4l2_mc_pci_media_device_init); - -struct media_device *__v4l2_mc_usb_media_device_init(struct usb_device *udev, - const char *board_name, - const char *driver_name) -{ -#ifdef CONFIG_USB - struct media_device *mdev; - - mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); - if (!mdev) - return NULL; - - mdev->dev = &udev->dev; - - if (driver_name) - strlcpy(mdev->driver_name, driver_name, - sizeof(mdev->driver_name)); - - if (board_name) - strlcpy(mdev->model, board_name, sizeof(mdev->model)); - else if (udev->product) - strlcpy(mdev->model, udev->product, sizeof(mdev->model)); - else - strlcpy(mdev->model, "unknown model", sizeof(mdev->model)); - if (udev->serial) - strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial)); - usb_make_path(udev, mdev->bus_info, sizeof(mdev->bus_info)); - mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); - mdev->driver_version = LINUX_VERSION_CODE; - - media_device_init(mdev); - - return mdev; -#else - return NULL; -#endif -} -EXPORT_SYMBOL_GPL(__v4l2_mc_usb_media_device_init); - int v4l2_mc_create_media_graph(struct media_device *mdev) { |