@@ -1224,10 +1224,6 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
void __user *up = compat_ptr(arg);
long ret;
- ret = uvc_pm_get(handle->stream->dev);
- if (ret)
- return ret;
-
switch (cmd) {
case UVCIOC_CTRL_MAP32:
ret = uvc_v4l2_get_xu_mapping(&karg.xmap, up);
@@ -1245,7 +1241,13 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
ret = uvc_v4l2_get_xu_query(&karg.xqry, up);
if (ret)
break;
+
+ ret = uvc_pm_get(handle->stream->dev);
+ if (ret)
+ return ret;
ret = uvc_xu_ctrl_query(handle->chain, &karg.xqry);
+ uvc_pm_put(handle->stream->dev);
+
if (ret)
break;
ret = uvc_v4l2_put_xu_query(&karg.xqry, up);
@@ -1258,8 +1260,6 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
break;
}
- uvc_pm_put(handle->stream->dev);
-
return ret;
}
#endif
The device does not need to be enabled to do this, it is merely an internal data operation. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> --- drivers/media/usb/uvc/uvc_v4l2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)