diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-05-05 07:01:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-05-05 07:01:34 -0400 |
commit | b34ecd5aa34800aefa9e2990a805243ec9348437 (patch) | |
tree | 9e2b2c2cece07d535714a36927370cf4cc6c4db6 /drivers/media/media-device.c | |
parent | 9b15dfe0542fd6f7455c6aeca1cf711192343bf9 (diff) |
[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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r-- | drivers/media/media-device.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 6e43c95629ea..3cfd7af8c5ca 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c | |||
@@ -846,11 +846,11 @@ struct media_device *media_device_find_devres(struct device *dev) | |||
846 | } | 846 | } |
847 | EXPORT_SYMBOL_GPL(media_device_find_devres); | 847 | EXPORT_SYMBOL_GPL(media_device_find_devres); |
848 | 848 | ||
849 | #if IS_ENABLED(CONFIG_PCI) | ||
849 | void media_device_pci_init(struct media_device *mdev, | 850 | void media_device_pci_init(struct media_device *mdev, |
850 | struct pci_dev *pci_dev, | 851 | struct pci_dev *pci_dev, |
851 | const char *name) | 852 | const char *name) |
852 | { | 853 | { |
853 | #ifdef CONFIG_PCI | ||
854 | mdev->dev = &pci_dev->dev; | 854 | mdev->dev = &pci_dev->dev; |
855 | 855 | ||
856 | if (name) | 856 | if (name) |
@@ -866,16 +866,16 @@ void media_device_pci_init(struct media_device *mdev, | |||
866 | mdev->driver_version = LINUX_VERSION_CODE; | 866 | mdev->driver_version = LINUX_VERSION_CODE; |
867 | 867 | ||
868 | media_device_init(mdev); | 868 | media_device_init(mdev); |
869 | #endif | ||
870 | } | 869 | } |
871 | EXPORT_SYMBOL_GPL(media_device_pci_init); | 870 | EXPORT_SYMBOL_GPL(media_device_pci_init); |
871 | #endif | ||
872 | 872 | ||
873 | #if IS_ENABLED(CONFIG_USB) | ||
873 | void __media_device_usb_init(struct media_device *mdev, | 874 | void __media_device_usb_init(struct media_device *mdev, |
874 | struct usb_device *udev, | 875 | struct usb_device *udev, |
875 | const char *board_name, | 876 | const char *board_name, |
876 | const char *driver_name) | 877 | const char *driver_name) |
877 | { | 878 | { |
878 | #ifdef CONFIG_USB | ||
879 | mdev->dev = &udev->dev; | 879 | mdev->dev = &udev->dev; |
880 | 880 | ||
881 | if (driver_name) | 881 | if (driver_name) |
@@ -895,9 +895,9 @@ void __media_device_usb_init(struct media_device *mdev, | |||
895 | mdev->driver_version = LINUX_VERSION_CODE; | 895 | mdev->driver_version = LINUX_VERSION_CODE; |
896 | 896 | ||
897 | media_device_init(mdev); | 897 | media_device_init(mdev); |
898 | #endif | ||
899 | } | 898 | } |
900 | EXPORT_SYMBOL_GPL(__media_device_usb_init); | 899 | EXPORT_SYMBOL_GPL(__media_device_usb_init); |
900 | #endif | ||
901 | 901 | ||
902 | 902 | ||
903 | #endif /* CONFIG_MEDIA_CONTROLLER */ | 903 | #endif /* CONFIG_MEDIA_CONTROLLER */ |