if (ici->icd)
return -EBUSY;
- if (ici->ops->clock_start) {
- ret = ici->ops->clock_start(ici);
+ ret = ici->ops->clock_start(ici);
+ if (ret < 0)
+ return ret;
+
+ if (ici->ops->add) {
+ ret = ici->ops->add(icd);
if (ret < 0)
- return ret;
+ goto eadd;
}
- ret = ici->ops->add(icd);
- if (ret < 0)
- goto eadd;
-
ici->icd = icd;
return 0;
eadd:
- if (ici->ops->clock_stop)
- ici->ops->clock_stop(ici);
+ ici->ops->clock_stop(ici);
return ret;
}
if (WARN_ON(icd != ici->icd))
return;
- ici->ops->remove(icd);
- if (ici->ops->clock_stop)
- ici->ops->clock_stop(ici);
+ if (ici->ops->remove)
+ ici->ops->remove(icd);
+ ici->ops->clock_stop(ici);
ici->icd = NULL;
}
((!ici->ops->init_videobuf ||
!ici->ops->reqbufs) &&
!ici->ops->init_videobuf2) ||
- !ici->ops->add ||
- !ici->ops->remove ||
+ !ici->ops->clock_start ||
+ !ici->ops->clock_stop ||
!ici->ops->poll ||
!ici->v4l2_dev.dev)
return -EINVAL;