aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-03-23 04:43:51 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-04-13 08:55:38 -0400
commitcb743930eb91e5b608c4491ce1b930dfeca43943 (patch)
tree5c54a2f5f1c90affea51917a21c1e928dc0638c9 /drivers
parentc8dd707805af100965c93cdca7d61e61165e9c07 (diff)
[media] sh_mobile_csi2: fix module reloading
If the camera host driver (sh_mobile_ceu_camera.c) is unloaded and then reloaded, probe will fail, because camera client .set_bus_param() and .query_bus_param() methods have been set to NULL. Fix this by caching the original pointers and restoring them on driver-unbind. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/sh_mobile_csi2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/sh_mobile_csi2.c b/drivers/media/video/sh_mobile_csi2.c
index 9e7c1a7c46c2..98b87481fa94 100644
--- a/drivers/media/video/sh_mobile_csi2.c
+++ b/drivers/media/video/sh_mobile_csi2.c
@@ -38,6 +38,8 @@ struct sh_csi2 {
38 void __iomem *base; 38 void __iomem *base;
39 struct platform_device *pdev; 39 struct platform_device *pdev;
40 struct sh_csi2_client_config *client; 40 struct sh_csi2_client_config *client;
41 unsigned long (*query_bus_param)(struct soc_camera_device *);
42 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
41}; 43};
42 44
43static int sh_csi2_try_fmt(struct v4l2_subdev *sd, 45static int sh_csi2_try_fmt(struct v4l2_subdev *sd,
@@ -216,6 +218,8 @@ static int sh_csi2_notify(struct notifier_block *nb,
216 218
217 priv->client = pdata->clients + i; 219 priv->client = pdata->clients + i;
218 220
221 priv->set_bus_param = icd->ops->set_bus_param;
222 priv->query_bus_param = icd->ops->query_bus_param;
219 icd->ops->set_bus_param = sh_csi2_set_bus_param; 223 icd->ops->set_bus_param = sh_csi2_set_bus_param;
220 icd->ops->query_bus_param = sh_csi2_query_bus_param; 224 icd->ops->query_bus_param = sh_csi2_query_bus_param;
221 225
@@ -227,8 +231,10 @@ static int sh_csi2_notify(struct notifier_block *nb,
227 priv->client = NULL; 231 priv->client = NULL;
228 232
229 /* Driver is about to be unbound */ 233 /* Driver is about to be unbound */
230 icd->ops->set_bus_param = NULL; 234 icd->ops->set_bus_param = priv->set_bus_param;
231 icd->ops->query_bus_param = NULL; 235 icd->ops->query_bus_param = priv->query_bus_param;
236 priv->set_bus_param = NULL;
237 priv->query_bus_param = NULL;
232 238
233 v4l2_device_unregister_subdev(&priv->subdev); 239 v4l2_device_unregister_subdev(&priv->subdev);
234 240