summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-22 12:10:49 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-23 07:19:39 -0300
commit6cf5dad17e913fce1ccb0c38e199eff15b0f03cc (patch)
treeb039fae16d8290e8d54e4e614a1a0fb3dfd7e34a /include/media
parent41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa (diff)
[media] media_device: move allocation out of media_device_*_init
Right now, media_device_pci_init and media_device_usb_init does media_device allocation internaly. That preents its usage when the media_device struct is embedded on some other structure. Move memory allocation outside it, to make it more generic. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/media-device.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 2d144fed936e..49dda6c7e664 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -550,16 +550,19 @@ struct media_device *media_device_find_devres(struct device *dev);
* media_device_pci_init() - create and initialize a
* struct &media_device from a PCI device.
*
+ * @mdev: pointer to struct &media_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);
+void media_device_pci_init(struct media_device *mdev,
+ struct pci_dev *pci_dev,
+ const char *name);
/**
* __media_device_usb_init() - create and initialize a
* struct &media_device from a PCI device.
*
+ * @mdev: pointer to struct &media_device
* @udev: pointer to struct usb_device
* @board_name: media device name. If %NULL, the routine will use the usb
* product name, if available.
@@ -570,9 +573,10 @@ struct media_device *media_device_pci_init(struct pci_dev *pci_dev,
* 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);
+void __media_device_usb_init(struct media_device *mdev,
+ struct usb_device *udev,
+ const char *board_name,
+ const char *driver_name);
#else
static inline int media_device_register(struct media_device *mdev)
@@ -599,24 +603,24 @@ 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)
+static inline void media_device_pci_init(struct media_device *mdev,
+ 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)
+static inline void __media_device_usb_init(struct media_device *mdev,
+ 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)
+#define media_device_usb_init(mdev, udev, name) \
+ __media_device_usb_init(mdev, udev, name, KBUILD_MODNAME)
#endif