* ------------------------------------------------------------------
*/
+struct cal_v4l2_async_subdev {
+ struct v4l2_async_subdev asd;
+ struct cal_ctx *ctx;
+};
+
+static inline struct cal_v4l2_async_subdev *
+to_cal_asd(struct v4l2_async_subdev *asd)
+{
+ return container_of(asd, struct cal_v4l2_async_subdev, asd);
+}
+
static int cal_async_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev,
struct v4l2_async_subdev *asd)
{
- struct cal_ctx *ctx = notifier_to_ctx(notifier);
+ struct cal_ctx *ctx = to_cal_asd(asd)->ctx;
if (ctx->phy->sensor) {
ctx_info(ctx, "Rejecting subdev %s (Already set!!)",
static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
{
+ struct cal_v4l2_async_subdev *casd;
struct v4l2_async_subdev *asd;
struct fwnode_handle *fwnode;
int ret;
return PTR_ERR(asd);
}
+ casd = to_cal_asd(asd);
+ casd->ctx = ctx;
+
ret = v4l2_async_notifier_register(&ctx->cal->v4l2_dev,
&ctx->notifier);
if (ret) {