summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap3isp
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2017-03-04 10:07:08 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-19 15:45:44 -0400
commit838a6c561899e7c595396321dede41bc04f1fb7e (patch)
treedc18ac670c6a8208601294299387b85e2c33d396 /drivers/media/platform/omap3isp
parent831f3494d2327ef581bdae934caa7b6c9bc34da8 (diff)
downloadtalos-obmc-linux-838a6c561899e7c595396321dede41bc04f1fb7e.tar.gz
talos-obmc-linux-838a6c561899e7c595396321dede41bc04f1fb7e.zip
media: omap3isp: Destroy CSI-2 phy mutexes in error and module removal
The CSI-2 phy driver did initialise mutexes in its init function but there was no corresponding cleanup function destroying them. Fix that. Also clean up ISP module initialisation a little. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/omap3isp')
-rw-r--r--drivers/media/platform/omap3isp/isp.c6
-rw-r--r--drivers/media/platform/omap3isp/ispcsiphy.c6
-rw-r--r--drivers/media/platform/omap3isp/ispcsiphy.h1
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 40d1a200be32..088dc8b1b78a 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1859,6 +1859,7 @@ static void isp_cleanup_modules(struct isp_device *isp)
omap3isp_ccdc_cleanup(isp);
omap3isp_ccp2_cleanup(isp);
omap3isp_csi2_cleanup(isp);
+ omap3isp_csiphy_cleanup(isp);
}
static int isp_initialize_modules(struct isp_device *isp)
@@ -1868,7 +1869,7 @@ static int isp_initialize_modules(struct isp_device *isp)
ret = omap3isp_csiphy_init(isp);
if (ret < 0) {
dev_err(isp->dev, "CSI PHY initialization failed\n");
- goto error_csiphy;
+ return ret;
}
ret = omap3isp_csi2_init(isp);
@@ -1936,7 +1937,8 @@ error_ccdc:
error_ccp2:
omap3isp_csi2_cleanup(isp);
error_csi2:
-error_csiphy:
+ omap3isp_csiphy_cleanup(isp);
+
return ret;
}
diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c b/drivers/media/platform/omap3isp/ispcsiphy.c
index 871d4fe09c7f..83940e9d8291 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.c
+++ b/drivers/media/platform/omap3isp/ispcsiphy.c
@@ -345,3 +345,9 @@ int omap3isp_csiphy_init(struct isp_device *isp)
return 0;
}
+
+void omap3isp_csiphy_cleanup(struct isp_device *isp)
+{
+ mutex_destroy(&isp->isp_csiphy1.mutex);
+ mutex_destroy(&isp->isp_csiphy2.mutex);
+}
diff --git a/drivers/media/platform/omap3isp/ispcsiphy.h b/drivers/media/platform/omap3isp/ispcsiphy.h
index 28b63b28f9f7..978ca5c80a6c 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.h
+++ b/drivers/media/platform/omap3isp/ispcsiphy.h
@@ -39,5 +39,6 @@ struct isp_csiphy {
int omap3isp_csiphy_acquire(struct isp_csiphy *phy);
void omap3isp_csiphy_release(struct isp_csiphy *phy);
int omap3isp_csiphy_init(struct isp_device *isp);
+void omap3isp_csiphy_cleanup(struct isp_device *isp);
#endif /* OMAP3_ISP_CSI_PHY_H */
OpenPOWER on IntegriCloud