From: Mauro Carvalho Chehab Date: Wed, 10 Nov 2021 13:08:28 +0000 (+0000) Subject: media: atomisp: simplify asd check on open() fops X-Git-Tag: v6.6.17~8435^2~315 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=245f6f4a32fe7f60260f8ffdf4d5173bf3bebbca;p=platform%2Fkernel%2Flinux-rpi.git 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: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index c7ac313..94ba8ac 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -901,7 +901,7 @@ done: 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;