When ISI channel0 is used to recevice camera data, it can
not be used to mem2mem. So return -EBUSY error code when
user try to use them at the same time.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit
c6d5bf866819deaaf4900ae47d575c5a36d30a66)
dev_dbg(dev, "%s, ISI%d\n", __func__, mxc_isi->id);
+ if (atomic_read(&mxc_isi->open_count) > 0) {
+ dev_err(dev, "%s: ISI channel[%d] is busy\n", __func__, mxc_isi->id);
+ return -EBUSY;
+ }
+
if (mutex_lock_interruptible(&mxc_isi->lock))
return -ERESTARTSYS;
mxc_ctx = kzalloc(sizeof(*mxc_ctx), GFP_KERNEL);