diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-09-09 05:40:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-03 16:29:00 -0400 |
commit | 2fbdc9bd42c993a6b179a4ddb972b551644aad6e (patch) | |
tree | f548d7481225963b38354359f4339cdca3e21b77 /drivers/media | |
parent | 443f483aa2494b93d73ba122cafdf2ef89989ed7 (diff) |
[media] V4L: sh_mobile_csi2: fix unbalanced pm_runtime_put()
If the sh_mobile_csi2 driver didn't attach to a client, normally, because
the respective device connects to the SoC over the parallel CEU interface
and doesn't use the CSI-2 controller, it also shouldn't call
pm_runtime_put() on attempted disconnect.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/sh_mobile_csi2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/sh_mobile_csi2.c b/drivers/media/video/sh_mobile_csi2.c index 91c680a72849..37706eb81f25 100644 --- a/drivers/media/video/sh_mobile_csi2.c +++ b/drivers/media/video/sh_mobile_csi2.c | |||
@@ -208,6 +208,9 @@ static int sh_csi2_client_connect(struct sh_csi2 *priv) | |||
208 | unsigned long common_flags, csi2_flags; | 208 | unsigned long common_flags, csi2_flags; |
209 | int i, ret; | 209 | int i, ret; |
210 | 210 | ||
211 | if (priv->client) | ||
212 | return -EBUSY; | ||
213 | |||
211 | for (i = 0; i < pdata->num_clients; i++) | 214 | for (i = 0; i < pdata->num_clients; i++) |
212 | if (&pdata->clients[i].pdev->dev == icd->pdev) | 215 | if (&pdata->clients[i].pdev->dev == icd->pdev) |
213 | break; | 216 | break; |
@@ -262,6 +265,9 @@ static int sh_csi2_client_connect(struct sh_csi2 *priv) | |||
262 | 265 | ||
263 | static void sh_csi2_client_disconnect(struct sh_csi2 *priv) | 266 | static void sh_csi2_client_disconnect(struct sh_csi2 *priv) |
264 | { | 267 | { |
268 | if (!priv->client) | ||
269 | return; | ||
270 | |||
265 | priv->client = NULL; | 271 | priv->client = NULL; |
266 | 272 | ||
267 | pm_runtime_put(v4l2_get_subdevdata(&priv->subdev)); | 273 | pm_runtime_put(v4l2_get_subdevdata(&priv->subdev)); |