media: atomisp: Move atomisp_streaming_count() check into __atomisp_css_recover()
Both callers of __atomisp_css_recover() check atomisp_streaming_count() first, move the check into __atomisp_css_recover(). And __atomisp_css_recover() already calls lockdep_assert_held(&isp->mutex), so drop that from atomisp_css_flush(). Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
93d3fb35aa
commit
0ecc5236d1
@@ -1282,6 +1282,9 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
|
||||
|
||||
lockdep_assert_held(&isp->mutex);
|
||||
|
||||
if (!atomisp_streaming_count(isp))
|
||||
return;
|
||||
|
||||
atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, false);
|
||||
|
||||
BUG_ON(isp->num_of_streams > MAX_STREAM_NUM);
|
||||
@@ -1434,20 +1437,12 @@ void atomisp_assert_recovery_work(struct work_struct *work)
|
||||
assert_recovery_work);
|
||||
|
||||
mutex_lock(&isp->mutex);
|
||||
|
||||
if (atomisp_streaming_count(isp))
|
||||
__atomisp_css_recover(isp, true);
|
||||
|
||||
__atomisp_css_recover(isp, true);
|
||||
mutex_unlock(&isp->mutex);
|
||||
}
|
||||
|
||||
void atomisp_css_flush(struct atomisp_device *isp)
|
||||
{
|
||||
lockdep_assert_held(&isp->mutex);
|
||||
|
||||
if (!atomisp_streaming_count(isp))
|
||||
return;
|
||||
|
||||
/* Start recover */
|
||||
__atomisp_css_recover(isp, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user