summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-22 11:42:04 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-23 07:18:45 -0300
commit41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa (patch)
tree32743771d16d1b18d305600dc66d0f4828fecbde /include/media
parent2ddf22eec4b88ab0d4235a140db8243eaaab5128 (diff)
downloadlinux-41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa.tar.bz2
[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 'include/media')
-rw-r--r--include/media/media-device.h53
-rw-r--r--include/media/v4l2-mc.h46
2 files changed, 53 insertions, 46 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 165451bc3985..2d144fed936e 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -333,6 +333,10 @@ struct media_device {
unsigned int notification);
};
+/* We don't need to include pci.h or usb.h here */
+struct pci_dev;
+struct usb_device;
+
#ifdef CONFIG_MEDIA_CONTROLLER
/* Supported link_notify @notification values. */
@@ -541,6 +545,35 @@ struct media_device *media_device_find_devres(struct device *dev);
/* Iterate over all links. */
#define media_device_for_each_link(link, mdev) \
list_for_each_entry(link, &(mdev)->links, graph_obj.list)
+
+/**
+ * media_device_pci_init() - create and initialize a
+ * struct &media_device from a PCI device.
+ *
+ * @pci_dev: pointer to struct pci_dev
+ * @name: media device name. If %NULL, the routine will use the default
+ * name for the pci device, given by pci_name() macro.
+ */
+struct media_device *media_device_pci_init(struct pci_dev *pci_dev,
+ const char *name);
+/**
+ * __media_device_usb_init() - create and initialize a
+ * struct &media_device from a PCI device.
+ *
+ * @udev: pointer to struct usb_device
+ * @board_name: media device name. If %NULL, the routine will use the usb
+ * product name, if available.
+ * @driver_name: name of the driver. if %NULL, the routine will use the name
+ * given by udev->dev->driver->name, with is usually the wrong
+ * thing to do.
+ *
+ * NOTE: It is better to call media_device_usb_init() instead, as
+ * such macro fills driver_name with %KBUILD_MODNAME.
+ */
+struct media_device *__media_device_usb_init(struct usb_device *udev,
+ const char *board_name,
+ const char *driver_name);
+
#else
static inline int media_device_register(struct media_device *mdev)
{
@@ -565,5 +598,25 @@ static inline struct media_device *media_device_find_devres(struct device *dev)
{
return NULL;
}
+
+static inline
+struct media_device *media_device_pci_init(struct pci_dev *pci_dev,
+ char *name)
+{
+ return NULL;
+}
+
+static inline
+struct media_device *__media_device_usb_init(struct usb_device *udev,
+ char *board_name,
+ char *driver_name)
+{
+ return NULL;
+}
+
#endif /* CONFIG_MEDIA_CONTROLLER */
+
+#define media_device_usb_init(udev, name) \
+ __media_device_usb_init(udev, name, KBUILD_MODNAME)
+
#endif
diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h
index 79d84bb3573c..431380eb408b 100644
--- a/include/media/v4l2-mc.h
+++ b/include/media/v4l2-mc.h
@@ -116,57 +116,11 @@ struct usb_device;
*/
int v4l2_mc_create_media_graph(struct media_device *mdev);
-/**
- * v4l2_mc_pci_media_device_init() - create and initialize a
- * struct &media_device from a PCI device.
- *
- * @pci_dev: pointer to struct pci_dev
- * @name: media device name. If %NULL, the routine will use the default
- * name for the pci device, given by pci_name() macro.
- */
-struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev,
- const char *name);
-/**
- * __v4l2_mc_usb_media_device_init() - create and initialize a
- * struct &media_device from a PCI device.
- *
- * @udev: pointer to struct usb_device
- * @board_name: media device name. If %NULL, the routine will use the usb
- * product name, if available.
- * @driver_name: name of the driver. if %NULL, the routine will use the name
- * given by udev->dev->driver->name, with is usually the wrong
- * thing to do.
- *
- * NOTE: It is better to call v4l2_mc_usb_media_device_init() instead, as
- * such macro fills driver_name with %KBUILD_MODNAME.
- */
-struct media_device *__v4l2_mc_usb_media_device_init(struct usb_device *udev,
- const char *board_name,
- const char *driver_name);
-
#else
static inline int v4l2_mc_create_media_graph(struct media_device *mdev)
{
return 0;
}
-static inline
-struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev,
- char *name)
-{
- return NULL;
-}
-
-static inline
-struct media_device *__v4l2_mc_usb_media_device_init(struct usb_device *udev,
- char *board_name,
- char *driver_name)
-{
- return NULL;
-}
#endif
-
-#define v4l2_mc_usb_media_device_init(udev, name) \
- __v4l2_mc_usb_media_device_init(udev, name, KBUILD_MODNAME)
-
#endif