Do not remove the per-context debugfs directory before the
per-buffer debugfs entries contained therein.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
        v4l2_dbg(1, coda_debug, &dev->v4l2_dev, "Releasing instance %p\n",
                 ctx);
 
-       debugfs_remove_recursive(ctx->debugfs_entry);
-
        if (ctx->inst_type == CODA_INST_DECODER)
                coda_bit_stream_end_flag(ctx);
 
        clear_bit(ctx->idx, &dev->instance_mask);
        if (ctx->ops->release)
                ctx->ops->release(ctx);
+       debugfs_remove_recursive(ctx->debugfs_entry);
        kfree(ctx);
 
        return 0;