summaryrefslogtreecommitdiff
path: root/linux/arch/sh
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 16:34:18 +0200
committerGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 16:34:18 +0200
commit6da682d61e1e10ecacc24682f5ee009b48c3e1f3 (patch)
tree8f463803d23c3091f63e67cae728e76fcf76cc3b /linux/arch/sh
parentf4d433778a3e919ae0496e7b680e15beb009f1f0 (diff)
downloadmediapointer-dvb-s2-6da682d61e1e10ecacc24682f5ee009b48c3e1f3.tar.gz
mediapointer-dvb-s2-6da682d61e1e10ecacc24682f5ee009b48c3e1f3.tar.bz2
sh: prepare board-ap325rxa.c for v4l2-subdev conversion
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> 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> Cc: Paul Mundt <lethal@linux-sh.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Priority: low --- arch/sh/boards/board-ap325rxa.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
Diffstat (limited to 'linux/arch/sh')
-rw-r--r--linux/arch/sh/boards/board-ap325rxa.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/linux/arch/sh/boards/board-ap325rxa.c b/linux/arch/sh/boards/board-ap325rxa.c
index 2a5dded5c..62cec8772 100644
--- a/linux/arch/sh/boards/board-ap325rxa.c
+++ b/linux/arch/sh/boards/board-ap325rxa.c
@@ -326,13 +326,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,
},
};
@@ -349,8 +355,11 @@ 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(&migor_camera_device.dev.kobj, 0, sizeof(migor_camera_device.dev.kobj));
}
#endif /* CONFIG_I2C */