diff options
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 14 |
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 | ||
336 | static void dummy_release(struct device *dev) | ||
337 | { | ||
338 | } | ||
339 | |||
335 | static struct platform_device camera_device = { | 340 | static 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 | ||
353 | static void ap325rxa_camera_del(struct soc_camera_link *icl) | 359 | static 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 | ||