msm: vidc: Clean up properly when instance exits at MSM_VIDC_INIT state

Whenever vidc device is required to move from INIT state to CLOSE state,
device state moves to INVALID state. For every state trasition there is a
call to get_flipped_state() routine, this routine validates target state
before actual transition. Due to safegaurding logic for target state in
routine get_flipped_state(), transition from INIT to CLOSE stae does not
happen and target state becomes INVALID state. From INVALID state device
can not be closed/unloaded and clock will be held on. As a part of fix,
change is done for graceful closure and unloading of device whenever device
is in INVALID state.

Change-Id: I8d69ce2ec7bcd76b1f384808bedaec21c66df5f5
Signed-off-by: c_sridur <sridur@codeaurora.org>
1 file changed