aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 10:34:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:18:33 -0400
commit0bab829de1ab60d8c3cbf7e402192bb9446840b7 (patch)
tree0473c9f8499bccf786c344ebfe194aebb3ed9444 /arch
parentdd4f0ad4b027078b0642d99a2d30c9c93a5e38ac (diff)
V4L/DVB (12509): sh: prepare board-ap325rxa.c for v4l2-subdev conversion
We will be registering and unregistering the soc_camera_platform platform device multiple times, therefore we need a .release() method and have to nullify the kobj. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/boards/board-ap325rxa.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index a89eb8b8531b..2d080732a964 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -329,13 +329,19 @@ static struct soc_camera_platform_info camera_info = {
329 .bus_id = 0, 329 .bus_id = 0,
330 .add_device = ap325rxa_camera_add, 330 .add_device = ap325rxa_camera_add,
331 .del_device = ap325rxa_camera_del, 331 .del_device = ap325rxa_camera_del,
332 .module_name = "soc_camera_platform",
332 }, 333 },
333}; 334};
334 335
336static void dummy_release(struct device *dev)
337{
338}
339
335static struct platform_device camera_device = { 340static struct platform_device camera_device = {
336 .name = "soc_camera_platform", 341 .name = "soc_camera_platform",
337 .dev = { 342 .dev = {
338 .platform_data = &camera_info, 343 .platform_data = &camera_info,
344 .release = dummy_release,
339 }, 345 },
340}; 346};
341 347
@@ -352,8 +358,12 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl,
352 358
353static void ap325rxa_camera_del(struct soc_camera_link *icl) 359static void ap325rxa_camera_del(struct soc_camera_link *icl)
354{ 360{
355 if (icl == &camera_info.link) 361 if (icl != &camera_info.link)
356 platform_device_unregister(&camera_device); 362 return;
363
364 platform_device_unregister(&camera_device);
365 memset(&camera_device.dev.kobj, 0,
366 sizeof(camera_device.dev.kobj));
357} 367}
358#endif /* CONFIG_I2C */ 368#endif /* CONFIG_I2C */
359 369