summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 11:34:18 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-19 00:18:33 -0300
commit0bab829de1ab60d8c3cbf7e402192bb9446840b7 (patch)
tree0473c9f8499bccf786c344ebfe194aebb3ed9444 /arch/sh
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/sh')
-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 = {
.bus_id = 0,
.add_device = ap325rxa_camera_add,
.del_device = ap325rxa_camera_del,
+ .module_name = "soc_camera_platform",
},
};
+static void dummy_release(struct device *dev)
+{
+}
+
static struct platform_device camera_device = {
.name = "soc_camera_platform",
.dev = {
.platform_data = &camera_info,
+ .release = dummy_release,
},
};
@@ -352,8 +358,12 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl,
static void ap325rxa_camera_del(struct soc_camera_link *icl)
{
- if (icl == &camera_info.link)
- platform_device_unregister(&camera_device);
+ if (icl != &camera_info.link)
+ return;
+
+ platform_device_unregister(&camera_device);
+ memset(&camera_device.dev.kobj, 0,
+ sizeof(camera_device.dev.kobj));
}
#endif /* CONFIG_I2C */