Commit 838a6c56 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

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: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 831f3494
...@@ -1859,6 +1859,7 @@ static void isp_cleanup_modules(struct isp_device *isp) ...@@ -1859,6 +1859,7 @@ static void isp_cleanup_modules(struct isp_device *isp)
omap3isp_ccdc_cleanup(isp); omap3isp_ccdc_cleanup(isp);
omap3isp_ccp2_cleanup(isp); omap3isp_ccp2_cleanup(isp);
omap3isp_csi2_cleanup(isp); omap3isp_csi2_cleanup(isp);
omap3isp_csiphy_cleanup(isp);
} }
static int isp_initialize_modules(struct isp_device *isp) static int isp_initialize_modules(struct isp_device *isp)
...@@ -1868,7 +1869,7 @@ 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); ret = omap3isp_csiphy_init(isp);
if (ret < 0) { if (ret < 0) {
dev_err(isp->dev, "CSI PHY initialization failed\n"); dev_err(isp->dev, "CSI PHY initialization failed\n");
goto error_csiphy; return ret;
} }
ret = omap3isp_csi2_init(isp); ret = omap3isp_csi2_init(isp);
...@@ -1936,7 +1937,8 @@ static int isp_initialize_modules(struct isp_device *isp) ...@@ -1936,7 +1937,8 @@ static int isp_initialize_modules(struct isp_device *isp)
error_ccp2: error_ccp2:
omap3isp_csi2_cleanup(isp); omap3isp_csi2_cleanup(isp);
error_csi2: error_csi2:
error_csiphy: omap3isp_csiphy_cleanup(isp);
return ret; return ret;
} }
......
...@@ -345,3 +345,9 @@ int omap3isp_csiphy_init(struct isp_device *isp) ...@@ -345,3 +345,9 @@ int omap3isp_csiphy_init(struct isp_device *isp)
return 0; return 0;
} }
void omap3isp_csiphy_cleanup(struct isp_device *isp)
{
mutex_destroy(&isp->isp_csiphy1.mutex);
mutex_destroy(&isp->isp_csiphy2.mutex);
}
...@@ -39,5 +39,6 @@ struct isp_csiphy { ...@@ -39,5 +39,6 @@ struct isp_csiphy {
int omap3isp_csiphy_acquire(struct isp_csiphy *phy); int omap3isp_csiphy_acquire(struct isp_csiphy *phy);
void omap3isp_csiphy_release(struct isp_csiphy *phy); void omap3isp_csiphy_release(struct isp_csiphy *phy);
int omap3isp_csiphy_init(struct isp_device *isp); int omap3isp_csiphy_init(struct isp_device *isp);
void omap3isp_csiphy_cleanup(struct isp_device *isp);
#endif /* OMAP3_ISP_CSI_PHY_H */ #endif /* OMAP3_ISP_CSI_PHY_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment