summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2014-06-12 13:09:39 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-21 19:43:03 -0300
commit605b38403b710ca01a242448241bc45c722b341b (patch)
treed38d346dfb8924b84f1ce7a0819a1f97eb546089 /include/media
parentc9adcb73b2da5eddfcb96bfa264bb61b6b83ac96 (diff)
[media] v4l: ctrls: Move control lock/unlock above the control access functions
The v4l2_ctrl_{,un}lock will be needed elsewhere. Define them before the functions that perform operations on controls. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-ctrls.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index c630345e9fd2..4546233a9a3d 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -367,6 +367,24 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
*/
void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl);
+/** v4l2_ctrl_lock() - Helper function to lock the handler
+ * associated with the control.
+ * @ctrl: The control to lock.
+ */
+static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl)
+{
+ mutex_lock(ctrl->handler->lock);
+}
+
+/** v4l2_ctrl_unlock() - Helper function to unlock the handler
+ * associated with the control.
+ * @ctrl: The control to unlock.
+ */
+static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl)
+{
+ mutex_unlock(ctrl->handler->lock);
+}
+
/** v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging
* to the handler to initialize the hardware to the current control values.
* @hdl: The control handler.
@@ -622,24 +640,6 @@ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
s64 min, s64 max, u64 step, s64 def);
-/** v4l2_ctrl_lock() - Helper function to lock the handler
- * associated with the control.
- * @ctrl: The control to lock.
- */
-static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl)
-{
- mutex_lock(ctrl->handler->lock);
-}
-
-/** v4l2_ctrl_unlock() - Helper function to unlock the handler
- * associated with the control.
- * @ctrl: The control to unlock.
- */
-static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl)
-{
- mutex_unlock(ctrl->handler->lock);
-}
-
/** v4l2_ctrl_notify() - Function to set a notify callback for a control.
* @ctrl: The control.
* @notify: The callback function.