media: omap3isp: Don't restart CCDC if we're about to stop
[sfrench/cifs-2.6.git] / drivers / media / platform / omap3isp / ispccdc.c
index e2f336c715a4d546805f584ff04528d69bea9ed8..471ae7cdb8133c3d3c754fcf44c6fe6d5725d74c 100644 (file)
@@ -1607,6 +1607,11 @@ static int ccdc_isr_buffer(struct isp_ccdc_device *ccdc)
                return 0;
        }
 
+       /* Don't restart CCDC if we're just about to stop streaming. */
+       if (ccdc->state == ISP_PIPELINE_STREAM_CONTINUOUS &&
+           ccdc->stopping & CCDC_STOP_REQUEST)
+               return 0;
+
        if (!ccdc_has_all_fields(ccdc))
                return 1;
 
@@ -1661,16 +1666,15 @@ static void ccdc_vd0_isr(struct isp_ccdc_device *ccdc)
                spin_unlock_irqrestore(&ccdc->lock, flags);
        }
 
-       if (ccdc->output & CCDC_OUTPUT_MEMORY)
-               restart = ccdc_isr_buffer(ccdc);
-
        spin_lock_irqsave(&ccdc->lock, flags);
-
        if (ccdc_handle_stopping(ccdc, CCDC_EVENT_VD0)) {
                spin_unlock_irqrestore(&ccdc->lock, flags);
                return;
        }
 
+       if (ccdc->output & CCDC_OUTPUT_MEMORY)
+               restart = ccdc_isr_buffer(ccdc);
+
        if (!ccdc->shadow_update)
                ccdc_apply_controls(ccdc);
        spin_unlock_irqrestore(&ccdc->lock, flags);