diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2017-09-29 11:54:10 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2017-10-24 17:08:33 +0200 |
commit | 72eaf99f0471d7e03e46f0d87770626430995df2 (patch) | |
tree | 9e79d4b333759c09337ce6221f42ff2e4cbf3066 /drivers/media | |
parent | 61065fc3e32002ba48aa6bc3816c1f6f9f8daf55 (diff) |
media: smiapp: Use __v4l2_ctrl_handler_setup()
Use unlocked __v4l2_ctrl_handler_setup() in order to make the
control setup atomic.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/smiapp/smiapp-core.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index fbd851be51d2..8de444080b8f 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -1325,24 +1325,28 @@ static int smiapp_power_on(struct device *dev) if (!sensor->pixel_array) return 0; - rval = v4l2_ctrl_handler_setup(&sensor->pixel_array->ctrl_handler); + mutex_lock(&sensor->mutex); + + rval = __v4l2_ctrl_handler_setup(&sensor->pixel_array->ctrl_handler); if (rval) - goto out_cci_addr_fail; + goto out_unlock; - rval = v4l2_ctrl_handler_setup(&sensor->src->ctrl_handler); + rval = __v4l2_ctrl_handler_setup(&sensor->src->ctrl_handler); if (rval) - goto out_cci_addr_fail; + goto out_unlock; - mutex_lock(&sensor->mutex); rval = smiapp_update_mode(sensor); - mutex_unlock(&sensor->mutex); if (rval < 0) - goto out_cci_addr_fail; + goto out_unlock; + + mutex_unlock(&sensor->mutex); return 0; -out_cci_addr_fail: +out_unlock: + mutex_unlock(&sensor->mutex); +out_cci_addr_fail: gpiod_set_value(sensor->xshutdown, 0); clk_disable_unprepare(sensor->ext_clk); |