Commit fe905b8c authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] omap3isp: ccp2: Don't ignore the regulator_enable() return value

Check the return value and catch errors correctly.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7c0f812a
...@@ -158,13 +158,17 @@ static void ccp2_pwr_cfg(struct isp_ccp2_device *ccp2) ...@@ -158,13 +158,17 @@ static void ccp2_pwr_cfg(struct isp_ccp2_device *ccp2)
* @ccp2: pointer to ISP CCP2 device * @ccp2: pointer to ISP CCP2 device
* @enable: enable/disable flag * @enable: enable/disable flag
*/ */
static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable) static int ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable)
{ {
struct isp_device *isp = to_isp_device(ccp2); struct isp_device *isp = to_isp_device(ccp2);
int ret;
int i; int i;
if (enable && ccp2->vdds_csib) if (enable && ccp2->vdds_csib) {
regulator_enable(ccp2->vdds_csib); ret = regulator_enable(ccp2->vdds_csib);
if (ret < 0)
return ret;
}
/* Enable/Disable all the LCx channels */ /* Enable/Disable all the LCx channels */
for (i = 0; i < CCP2_LCx_CHANS_NUM; i++) for (i = 0; i < CCP2_LCx_CHANS_NUM; i++)
...@@ -179,6 +183,8 @@ static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable) ...@@ -179,6 +183,8 @@ static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable)
if (!enable && ccp2->vdds_csib) if (!enable && ccp2->vdds_csib)
regulator_disable(ccp2->vdds_csib); regulator_disable(ccp2->vdds_csib);
return 0;
} }
/* /*
...@@ -851,7 +857,12 @@ static int ccp2_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -851,7 +857,12 @@ static int ccp2_s_stream(struct v4l2_subdev *sd, int enable)
ccp2_print_status(ccp2); ccp2_print_status(ccp2);
/* Enable CSI1/CCP2 interface */ /* Enable CSI1/CCP2 interface */
ccp2_if_enable(ccp2, 1); ret = ccp2_if_enable(ccp2, 1);
if (ret < 0) {
if (ccp2->phy)
omap3isp_csiphy_release(ccp2->phy);
return ret;
}
break; break;
case ISP_PIPELINE_STREAM_SINGLESHOT: case ISP_PIPELINE_STREAM_SINGLESHOT:
......
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