Commit 86a73144 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Paul Mundt

ARM: switch mackerel to dynamically manage the platform camera

Use soc_camera_platform helper functions to dynamically manage the
camera device.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent d08fe475
...@@ -886,37 +886,23 @@ static struct soc_camera_link camera_link = { ...@@ -886,37 +886,23 @@ static struct soc_camera_link camera_link = {
.priv = &camera_info, .priv = &camera_info,
}; };
static void dummy_release(struct device *dev) static struct platform_device *camera_device;
static void mackerel_camera_release(struct device *dev)
{ {
soc_camera_platform_release(&camera_device);
} }
static struct platform_device camera_device = {
.name = "soc_camera_platform",
.dev = {
.platform_data = &camera_info,
.release = dummy_release,
},
};
static int mackerel_camera_add(struct soc_camera_link *icl, static int mackerel_camera_add(struct soc_camera_link *icl,
struct device *dev) struct device *dev)
{ {
if (icl != &camera_link) return soc_camera_platform_add(icl, dev, &camera_device, &camera_link,
return -ENODEV; mackerel_camera_release, 0);
camera_info.dev = dev;
return platform_device_register(&camera_device);
} }
static void mackerel_camera_del(struct soc_camera_link *icl) static void mackerel_camera_del(struct soc_camera_link *icl)
{ {
if (icl != &camera_link) soc_camera_platform_del(icl, camera_device, &camera_link);
return;
platform_device_unregister(&camera_device);
memset(&camera_device.dev.kobj, 0,
sizeof(camera_device.dev.kobj));
} }
static struct sh_mobile_ceu_info sh_mobile_ceu_info = { static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
......
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