aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-mackerel.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-02-22 04:57:49 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-05-24 02:25:02 -0400
commit86a73144a72b1d2e7f3df06f806dbc08b77c07e6 (patch)
tree7aee275a101938ebc97b509b34e889ed8ba28a6a /arch/arm/mach-shmobile/board-mackerel.c
parentd08fe475120e3f17df37656d0644c0f17a797852 (diff)
ARM: switch mackerel to dynamically manage the platform camera
Use soc_camera_platform helper functions to dynamically manage the camera device. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index ca5b35bd2466..efceb1d4d17a 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -886,37 +886,23 @@ static struct soc_camera_link camera_link = {
886 .priv = &camera_info, 886 .priv = &camera_info,
887}; 887};
888 888
889static void dummy_release(struct device *dev) 889static struct platform_device *camera_device;
890
891static void mackerel_camera_release(struct device *dev)
890{ 892{
893 soc_camera_platform_release(&camera_device);
891} 894}
892 895
893static struct platform_device camera_device = {
894 .name = "soc_camera_platform",
895 .dev = {
896 .platform_data = &camera_info,
897 .release = dummy_release,
898 },
899};
900
901static int mackerel_camera_add(struct soc_camera_link *icl, 896static int mackerel_camera_add(struct soc_camera_link *icl,
902 struct device *dev) 897 struct device *dev)
903{ 898{
904 if (icl != &camera_link) 899 return soc_camera_platform_add(icl, dev, &camera_device, &camera_link,
905 return -ENODEV; 900 mackerel_camera_release, 0);
906
907 camera_info.dev = dev;
908
909 return platform_device_register(&camera_device);
910} 901}
911 902
912static void mackerel_camera_del(struct soc_camera_link *icl) 903static void mackerel_camera_del(struct soc_camera_link *icl)
913{ 904{
914 if (icl != &camera_link) 905 soc_camera_platform_del(icl, camera_device, &camera_link);
915 return;
916
917 platform_device_unregister(&camera_device);
918 memset(&camera_device.dev.kobj, 0,
919 sizeof(camera_device.dev.kobj));
920} 906}
921 907
922static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 908static struct sh_mobile_ceu_info sh_mobile_ceu_info = {