diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2018-05-25 11:25:11 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-06-05 09:46:45 -0400 |
| commit | ee20a4459ee5afdc5c69725abd438e20cc4ac0ad (patch) | |
| tree | 630995bba61eb906e51f2d12eb2938748614cda6 /drivers/media | |
| parent | 0dc68cabdb626e33d02561529e6a4c681b72a784 (diff) | |
media: marvel-ccic: allow ccic and mmp drivers to coexist
Randconfig builds fail when one of the two is a built-in driver and
the other one is a loadable module:
drivers/media/platform/marvell-ccic/mcam-core.o: In function `mccic_register':
mcam-core.c:(.text+0x2594): undefined reference to `__this_module'
drivers/media/platform/marvell-ccic/mcam-core.o:(.rodata+0x50): undefined reference to `__this_module'
The problem is that mcam-core.c can not be built both ways at the smae
time. However, we can make kbuild take care of that by making the core
driver a separate module, which can be either built-in or loadable
as needed.
Making it a separate module requires exporting a few symbols and
adding the module license from the header.
Fixes: 0a9c643c8faa ("media: marvel-ccic: re-enable mmp-driver build")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
| -rw-r--r-- | drivers/media/platform/marvell-ccic/Makefile | 9 | ||||
| -rw-r--r-- | drivers/media/platform/marvell-ccic/mcam-core.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/media/platform/marvell-ccic/Makefile b/drivers/media/platform/marvell-ccic/Makefile index 05a792c579a2..b3a4d0cdccb8 100644 --- a/drivers/media/platform/marvell-ccic/Makefile +++ b/drivers/media/platform/marvell-ccic/Makefile | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o | 1 | obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o mcam-core.o |
| 2 | cafe_ccic-y := cafe-driver.o mcam-core.o | 2 | cafe_ccic-y := cafe-driver.o |
| 3 | |||
| 4 | obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o | ||
| 5 | mmp_camera-y := mmp-driver.o mcam-core.o | ||
| 6 | 3 | ||
| 4 | obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o mcam-core.o | ||
| 5 | mmp_camera-y := mmp-driver.o | ||
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c index 80670eeee142..dfdbd4354b74 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.c +++ b/drivers/media/platform/marvell-ccic/mcam-core.c | |||
| @@ -1720,6 +1720,7 @@ int mccic_irq(struct mcam_camera *cam, unsigned int irqs) | |||
| 1720 | } | 1720 | } |
| 1721 | return handled; | 1721 | return handled; |
| 1722 | } | 1722 | } |
| 1723 | EXPORT_SYMBOL_GPL(mccic_irq); | ||
| 1723 | 1724 | ||
| 1724 | /* ---------------------------------------------------------------------- */ | 1725 | /* ---------------------------------------------------------------------- */ |
| 1725 | /* | 1726 | /* |
| @@ -1830,7 +1831,7 @@ out_unregister: | |||
| 1830 | v4l2_device_unregister(&cam->v4l2_dev); | 1831 | v4l2_device_unregister(&cam->v4l2_dev); |
| 1831 | return ret; | 1832 | return ret; |
| 1832 | } | 1833 | } |
| 1833 | 1834 | EXPORT_SYMBOL_GPL(mccic_register); | |
| 1834 | 1835 | ||
| 1835 | void mccic_shutdown(struct mcam_camera *cam) | 1836 | void mccic_shutdown(struct mcam_camera *cam) |
| 1836 | { | 1837 | { |
| @@ -1850,6 +1851,7 @@ void mccic_shutdown(struct mcam_camera *cam) | |||
| 1850 | v4l2_ctrl_handler_free(&cam->ctrl_handler); | 1851 | v4l2_ctrl_handler_free(&cam->ctrl_handler); |
| 1851 | v4l2_device_unregister(&cam->v4l2_dev); | 1852 | v4l2_device_unregister(&cam->v4l2_dev); |
| 1852 | } | 1853 | } |
| 1854 | EXPORT_SYMBOL_GPL(mccic_shutdown); | ||
| 1853 | 1855 | ||
| 1854 | /* | 1856 | /* |
| 1855 | * Power management | 1857 | * Power management |
| @@ -1868,6 +1870,7 @@ void mccic_suspend(struct mcam_camera *cam) | |||
| 1868 | } | 1870 | } |
| 1869 | mutex_unlock(&cam->s_mutex); | 1871 | mutex_unlock(&cam->s_mutex); |
| 1870 | } | 1872 | } |
| 1873 | EXPORT_SYMBOL_GPL(mccic_suspend); | ||
| 1871 | 1874 | ||
| 1872 | int mccic_resume(struct mcam_camera *cam) | 1875 | int mccic_resume(struct mcam_camera *cam) |
| 1873 | { | 1876 | { |
| @@ -1898,4 +1901,8 @@ int mccic_resume(struct mcam_camera *cam) | |||
| 1898 | } | 1901 | } |
| 1899 | return ret; | 1902 | return ret; |
| 1900 | } | 1903 | } |
| 1904 | EXPORT_SYMBOL_GPL(mccic_resume); | ||
| 1901 | #endif /* CONFIG_PM */ | 1905 | #endif /* CONFIG_PM */ |
| 1906 | |||
| 1907 | MODULE_LICENSE("GPL v2"); | ||
| 1908 | MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>"); | ||
