From c0cc496bc56d4704a335f9f9931f324ad07d9d96 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 8 Feb 2012 00:58:18 +0100 Subject: controls: Make sure subdev is open before setting CCDC black level Signed-off-by: Laurent Pinchart --- isp/controls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'isp/controls.c') diff --git a/isp/controls.c b/isp/controls.c index 421b4bf..f75402b 100644 --- a/isp/controls.c +++ b/isp/controls.c @@ -162,6 +162,8 @@ int omap3_isp_ccdc_set_black_level(struct omap3_isp_device *isp, unsigned int va struct omap3isp_ccdc_bclamp bclamp; int ret; + v4l2_subdev_open(isp->ccdc.entity); + memset(&config, 0, sizeof config); config.update = OMAP3ISP_CCDC_BLCLAMP; config.flag = 0; @@ -171,8 +173,10 @@ int omap3_isp_ccdc_set_black_level(struct omap3_isp_device *isp, unsigned int va bclamp.dcsubval = value; ret = ioctl(isp->ccdc.entity->fd, VIDIOC_OMAP3ISP_CCDC_CFG, &config); - if (ret < 0) + if (ret < 0) { + printf("%s: %s (%d)\n", __func__, strerror(errno), errno); return -errno; + } return ret; } -- cgit v1.2.3