Commit b34ecd5a authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media-device: fix builds when USB or PCI is compiled as module

Just checking ifdef CONFIG_USB is not enough, if the USB is compiled
as module. The same applies to PCI.

Tested with the following .config alternatives:

CONFIG_USB=m
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=m
CONFIG_VIDEO_AU0828=m

CONFIG_USB=m
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_AU0828=m

CONFIG_USB=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_AU0828=m

CONFIG_USB=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_AU0828=y
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9b15dfe0
...@@ -846,11 +846,11 @@ struct media_device *media_device_find_devres(struct device *dev) ...@@ -846,11 +846,11 @@ struct media_device *media_device_find_devres(struct device *dev)
} }
EXPORT_SYMBOL_GPL(media_device_find_devres); EXPORT_SYMBOL_GPL(media_device_find_devres);
#if IS_ENABLED(CONFIG_PCI)
void media_device_pci_init(struct media_device *mdev, void media_device_pci_init(struct media_device *mdev,
struct pci_dev *pci_dev, struct pci_dev *pci_dev,
const char *name) const char *name)
{ {
#ifdef CONFIG_PCI
mdev->dev = &pci_dev->dev; mdev->dev = &pci_dev->dev;
if (name) if (name)
...@@ -866,16 +866,16 @@ void media_device_pci_init(struct media_device *mdev, ...@@ -866,16 +866,16 @@ void media_device_pci_init(struct media_device *mdev,
mdev->driver_version = LINUX_VERSION_CODE; mdev->driver_version = LINUX_VERSION_CODE;
media_device_init(mdev); media_device_init(mdev);
#endif
} }
EXPORT_SYMBOL_GPL(media_device_pci_init); EXPORT_SYMBOL_GPL(media_device_pci_init);
#endif
#if IS_ENABLED(CONFIG_USB)
void __media_device_usb_init(struct media_device *mdev, void __media_device_usb_init(struct media_device *mdev,
struct usb_device *udev, struct usb_device *udev,
const char *board_name, const char *board_name,
const char *driver_name) const char *driver_name)
{ {
#ifdef CONFIG_USB
mdev->dev = &udev->dev; mdev->dev = &udev->dev;
if (driver_name) if (driver_name)
...@@ -895,9 +895,9 @@ void __media_device_usb_init(struct media_device *mdev, ...@@ -895,9 +895,9 @@ void __media_device_usb_init(struct media_device *mdev,
mdev->driver_version = LINUX_VERSION_CODE; mdev->driver_version = LINUX_VERSION_CODE;
media_device_init(mdev); media_device_init(mdev);
#endif
} }
EXPORT_SYMBOL_GPL(__media_device_usb_init); EXPORT_SYMBOL_GPL(__media_device_usb_init);
#endif
#endif /* CONFIG_MEDIA_CONTROLLER */ #endif /* CONFIG_MEDIA_CONTROLLER */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment