return 0;
unregister_dev:
- i--;
- for (; i >= 0; i--) {
+ while (i--) {
media_entity_remove_links(&csi->ctx[i].vdev.entity);
video_unregister_device(&csi->ctx[i].vdev);
}
struct ti_csi2rx_ctx *ctx;
struct ti_csi2rx_dma *dma;
unsigned long flags = 0;
- int i, ret = 0;
+ int ret = 0;
/* If device was not in use we can simply suspend */
if (pm_runtime_status_suspended(dev))
*/
writel(0, csi->shim + SHIM_CNTL);
- for (i = 0; i < csi->num_ctx; i++) {
+ for (unsigned int i = 0; i < csi->num_ctx; i++) {
ctx = &csi->ctx[i];
dma = &ctx->dma;
struct ti_csi2rx_buffer *buf;
unsigned long flags = 0;
unsigned int reg;
- int i, ret = 0;
+ int ret = 0;
/* If device was not in use, we can simply wakeup */
if (pm_runtime_status_suspended(dev))
reg = SHIM_CNTL_PIX_RST;
writel(reg, csi->shim + SHIM_CNTL);
- for (i = 0; i < csi->num_ctx; i++) {
+ for (unsigned int i = 0; i < csi->num_ctx; i++) {
ctx = &csi->ctx[i];
dma = &ctx->dma;
spin_lock_irqsave(&dma->lock, flags);
err_notifier:
ti_csi2rx_cleanup_notifier(csi);
err_ctx:
- i--;
- for (; i >= 0; i--)
+ while (i--)
ti_csi2rx_cleanup_ctx(&csi->ctx[i]);
ti_csi2rx_cleanup_v4l2(csi);
err_dma_chan:
static void ti_csi2rx_remove(struct platform_device *pdev)
{
struct ti_csi2rx_dev *csi = platform_get_drvdata(pdev);
- unsigned int i;
if (!pm_runtime_status_suspended(&pdev->dev))
pm_runtime_set_suspended(&pdev->dev);
- for (i = 0; i < csi->num_ctx; i++)
+ for (unsigned int i = 0; i < csi->num_ctx; i++)
ti_csi2rx_cleanup_ctx(&csi->ctx[i]);
ti_csi2rx_cleanup_notifier(csi);