mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-20 14:16:02 +00:00
staging/vc04_services: Register a platform device for the camera driver.
We had the camera driver set up in a module_init function, but that meant that the camera driver would fail to load if it was initialized before VCHI. By attaching to this platform_device, it can get a defined load order. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
00135fc5c3
commit
37b7b3087a
1 changed files with 6 additions and 0 deletions
|
@ -168,6 +168,7 @@ static VCHIQ_STATE_T g_state;
|
||||||
static struct class *vchiq_class;
|
static struct class *vchiq_class;
|
||||||
static struct device *vchiq_dev;
|
static struct device *vchiq_dev;
|
||||||
static DEFINE_SPINLOCK(msg_queue_spinlock);
|
static DEFINE_SPINLOCK(msg_queue_spinlock);
|
||||||
|
static struct platform_device *bcm2835_camera;
|
||||||
|
|
||||||
static const char *const ioctl_names[] = {
|
static const char *const ioctl_names[] = {
|
||||||
"CONNECT",
|
"CONNECT",
|
||||||
|
@ -3638,6 +3639,10 @@ static int vchiq_probe(struct platform_device *pdev)
|
||||||
VCHIQ_VERSION, VCHIQ_VERSION_MIN,
|
VCHIQ_VERSION, VCHIQ_VERSION_MIN,
|
||||||
MAJOR(vchiq_devid), MINOR(vchiq_devid));
|
MAJOR(vchiq_devid), MINOR(vchiq_devid));
|
||||||
|
|
||||||
|
bcm2835_camera = platform_device_register_data(&pdev->dev,
|
||||||
|
"bcm2835-camera", -1,
|
||||||
|
NULL, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
failed_debugfs_init:
|
failed_debugfs_init:
|
||||||
|
@ -3655,6 +3660,7 @@ static int vchiq_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
static int vchiq_remove(struct platform_device *pdev)
|
static int vchiq_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
platform_device_unregister(bcm2835_camera);
|
||||||
vchiq_debugfs_deinit();
|
vchiq_debugfs_deinit();
|
||||||
device_destroy(vchiq_class, vchiq_devid);
|
device_destroy(vchiq_class, vchiq_devid);
|
||||||
class_destroy(vchiq_class);
|
class_destroy(vchiq_class);
|
||||||
|
|
Loading…
Reference in a new issue