Commit 245f6f4a authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: simplify asd check on open() fops

The open() fops support two types of devices: "acc" and normal
ones. the acc works on a different way, using a different pipe
struct. Not sure yet if it would make sense to setup a run_mode
there. Also, As default_run_mode exists only on normal modes,
we can simplify the logic to check if the device is in normal
mode.

That solves this warning:

	../drivers/staging/media/atomisp/pci/atomisp_fops.c:904 atomisp_open() warn: variable dereferenced before check 'asd' (see line 807)
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 71665d81
......@@ -901,7 +901,7 @@ static int atomisp_open(struct file *file)
rt_mutex_unlock(&isp->mutex);
/* Ensure that a mode is set */
if (asd && pipe)
if (!acc_node)
v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode);
return 0;
......
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