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: 0a9c643c8f
("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>
This commit is contained in:
parent
0dc68cabdb
commit
ee20a4459e
|
@ -1,6 +1,5 @@
|
||||||
obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o
|
obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o mcam-core.o
|
||||||
cafe_ccic-y := cafe-driver.o mcam-core.o
|
cafe_ccic-y := cafe-driver.o
|
||||||
|
|
||||||
obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o
|
|
||||||
mmp_camera-y := mmp-driver.o mcam-core.o
|
|
||||||
|
|
||||||
|
obj-$(CONFIG_VIDEO_MMP_CAMERA) += mmp_camera.o mcam-core.o
|
||||||
|
mmp_camera-y := mmp-driver.o
|
||||||
|
|
|
@ -1720,6 +1720,7 @@ int mccic_irq(struct mcam_camera *cam, unsigned int irqs)
|
||||||
}
|
}
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mccic_irq);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/*
|
/*
|
||||||
|
@ -1830,7 +1831,7 @@ out_unregister:
|
||||||
v4l2_device_unregister(&cam->v4l2_dev);
|
v4l2_device_unregister(&cam->v4l2_dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mccic_register);
|
||||||
|
|
||||||
void mccic_shutdown(struct mcam_camera *cam)
|
void mccic_shutdown(struct mcam_camera *cam)
|
||||||
{
|
{
|
||||||
|
@ -1850,6 +1851,7 @@ void mccic_shutdown(struct mcam_camera *cam)
|
||||||
v4l2_ctrl_handler_free(&cam->ctrl_handler);
|
v4l2_ctrl_handler_free(&cam->ctrl_handler);
|
||||||
v4l2_device_unregister(&cam->v4l2_dev);
|
v4l2_device_unregister(&cam->v4l2_dev);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mccic_shutdown);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Power management
|
* Power management
|
||||||
|
@ -1868,6 +1870,7 @@ void mccic_suspend(struct mcam_camera *cam)
|
||||||
}
|
}
|
||||||
mutex_unlock(&cam->s_mutex);
|
mutex_unlock(&cam->s_mutex);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mccic_suspend);
|
||||||
|
|
||||||
int mccic_resume(struct mcam_camera *cam)
|
int mccic_resume(struct mcam_camera *cam)
|
||||||
{
|
{
|
||||||
|
@ -1898,4 +1901,8 @@ int mccic_resume(struct mcam_camera *cam)
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mccic_resume);
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL v2");
|
||||||
|
MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
|
||||||
|
|
Loading…
Reference in a new issue