return 0;
}
+static void cal_ctx_v4l2_unregister(struct cal_ctx *ctx)
+{
+ video_unregister_device(&ctx->vdev);
+}
+
static int cal_ctx_v4l2_init(struct cal_ctx *ctx)
{
struct v4l2_ctrl_handler *hdl = &ctx->ctrl_handler;
return 0;
}
+static void cal_ctx_v4l2_cleanup(struct cal_ctx *ctx)
+{
+ v4l2_ctrl_handler_free(&ctx->ctrl_handler);
+}
+
/* ------------------------------------------------------------------
* Initialization and module stuff
* ------------------------------------------------------------------
if (ctx) {
v4l2_async_notifier_unregister(&ctx->notifier);
v4l2_async_notifier_cleanup(&ctx->notifier);
- v4l2_ctrl_handler_free(&ctx->ctrl_handler);
+ cal_ctx_v4l2_cleanup(ctx);
}
}
cal_camerarx_disable(ctx->phy);
v4l2_async_notifier_unregister(&ctx->notifier);
v4l2_async_notifier_cleanup(&ctx->notifier);
- v4l2_ctrl_handler_free(&ctx->ctrl_handler);
- video_unregister_device(&ctx->vdev);
+ cal_ctx_v4l2_cleanup(ctx);
+ cal_ctx_v4l2_unregister(ctx);
}
}