aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc/uvc_v4l2.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2020-12-23 14:35:27 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-27 15:08:19 +0100
commit9e56380ae62543fc2043715050b80d494b2b1553 (patch)
treeae50075d464b48c8c9cbcfa68b1d3c17bca824ac /drivers/media/usb/uvc/uvc_v4l2.c
parentmedia: uvcvideo: use dev_printk() for uvc_trace() (diff)
downloadlinux-dev-9e56380ae62543fc2043715050b80d494b2b1553.tar.xz
linux-dev-9e56380ae62543fc2043715050b80d494b2b1553.zip
media: uvcvideo: Rename debug functions
trace isn't a good name as it's not a trace mechanism, it is a typical debug mechanism. Rename uvc_trace/uvc_trace_cont macros to uvc_dbg/uvc_dbg_cont. Rename uvc_trace_param to uvc_dbg_param Rename UVC_TRACE_<FOO> defines to UVC_DBG_<FOO> Use ## concatenation in uvc_dbg macros to avoid overly long and repetitive UVC_DBG uses Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_v4l2.c')
-rw-r--r--drivers/media/usb/uvc/uvc_v4l2.c57
1 files changed, 26 insertions, 31 deletions
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 42fac7d302d3..252136cc885c 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -75,9 +75,8 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
break;
default:
- uvc_trace(chain->dev, UVC_TRACE_CONTROL,
- "Unsupported V4L2 control type %u.\n",
- xmap->v4l2_type);
+ uvc_dbg(chain->dev, CONTROL,
+ "Unsupported V4L2 control type %u\n", xmap->v4l2_type);
ret = -ENOTTY;
goto free_map;
}
@@ -165,11 +164,10 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
return -EINVAL;
fcc = (u8 *)&fmt->fmt.pix.pixelformat;
- uvc_trace(stream->dev, UVC_TRACE_FORMAT,
- "Trying format 0x%08x (%c%c%c%c): %ux%u.\n",
- fmt->fmt.pix.pixelformat,
- fcc[0], fcc[1], fcc[2], fcc[3],
- fmt->fmt.pix.width, fmt->fmt.pix.height);
+ uvc_dbg(stream->dev, FORMAT, "Trying format 0x%08x (%c%c%c%c): %ux%u\n",
+ fmt->fmt.pix.pixelformat,
+ fcc[0], fcc[1], fcc[2], fcc[3],
+ fmt->fmt.pix.width, fmt->fmt.pix.height);
/* Check if the hardware supports the requested format, use the default
* format otherwise.
@@ -209,18 +207,17 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
}
if (frame == NULL) {
- uvc_trace(stream->dev, UVC_TRACE_FORMAT,
- "Unsupported size %ux%u.\n", fmt->fmt.pix.width,
- fmt->fmt.pix.height);
+ uvc_dbg(stream->dev, FORMAT, "Unsupported size %ux%u\n",
+ fmt->fmt.pix.width, fmt->fmt.pix.height);
return -EINVAL;
}
/* Use the default frame interval. */
interval = frame->dwDefaultFrameInterval;
- uvc_trace(stream->dev, UVC_TRACE_FORMAT,
- "Using default frame interval %u.%u us (%u.%u fps).\n",
- interval / 10, interval % 10, 10000000 / interval,
- (100000000 / interval) % 10);
+ uvc_dbg(stream->dev, FORMAT,
+ "Using default frame interval %u.%u us (%u.%u fps)\n",
+ interval / 10, interval % 10, 10000000 / interval,
+ (100000000 / interval) % 10);
/* Set the format index, frame index and frame interval. */
memset(probe, 0, sizeof(*probe));
@@ -264,9 +261,9 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
}
if (i == stream->nformats)
- uvc_trace(stream->dev, UVC_TRACE_FORMAT,
- "Unknown bFormatIndex %u, using default\n",
- probe->bFormatIndex);
+ uvc_dbg(stream->dev, FORMAT,
+ "Unknown bFormatIndex %u, using default\n",
+ probe->bFormatIndex);
for (i = 0; i < format->nframes; ++i) {
if (probe->bFrameIndex == format->frame[i].bFrameIndex) {
@@ -276,9 +273,9 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
}
if (i == format->nframes)
- uvc_trace(stream->dev, UVC_TRACE_FORMAT,
- "Unknown bFrameIndex %u, using default\n",
- probe->bFrameIndex);
+ uvc_dbg(stream->dev, FORMAT,
+ "Unknown bFrameIndex %u, using default\n",
+ probe->bFrameIndex);
fmt->fmt.pix.width = frame->wWidth;
fmt->fmt.pix.height = frame->wHeight;
@@ -420,9 +417,8 @@ static int uvc_v4l2_set_streamparm(struct uvc_streaming *stream,
interval = uvc_fraction_to_interval(timeperframe.numerator,
timeperframe.denominator);
- uvc_trace(stream->dev, UVC_TRACE_FORMAT,
- "Setting frame interval to %u/%u (%u).\n",
- timeperframe.numerator, timeperframe.denominator, interval);
+ uvc_dbg(stream->dev, FORMAT, "Setting frame interval to %u/%u (%u)\n",
+ timeperframe.numerator, timeperframe.denominator, interval);
mutex_lock(&stream->mutex);
@@ -551,7 +547,7 @@ static int uvc_v4l2_open(struct file *file)
int ret = 0;
stream = video_drvdata(file);
- uvc_trace(stream->dev, UVC_TRACE_CALLS, "%s\n", __func__);
+ uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
ret = usb_autopm_get_interface(stream->dev->intf);
if (ret < 0)
@@ -593,7 +589,7 @@ static int uvc_v4l2_release(struct file *file)
struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;
- uvc_trace(stream->dev, UVC_TRACE_CALLS, "%s\n", __func__);
+ uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
/* Only free resources if this is a privileged handle. */
if (uvc_has_privileges(handle))
@@ -1469,8 +1465,7 @@ static ssize_t uvc_v4l2_read(struct file *file, char __user *data,
struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;
- uvc_trace(stream->dev, UVC_TRACE_CALLS,
- "uvc_v4l2_read: not implemented.\n");
+ uvc_dbg(stream->dev, CALLS, "%s: not implemented\n", __func__);
return -EINVAL;
}
@@ -1479,7 +1474,7 @@ static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;
- uvc_trace(stream->dev, UVC_TRACE_CALLS, "%s\n", __func__);
+ uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
return uvc_queue_mmap(&stream->queue, vma);
}
@@ -1489,7 +1484,7 @@ static __poll_t uvc_v4l2_poll(struct file *file, poll_table *wait)
struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;
- uvc_trace(stream->dev, UVC_TRACE_CALLS, "%s\n", __func__);
+ uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
return uvc_queue_poll(&stream->queue, file, wait);
}
@@ -1502,7 +1497,7 @@ static unsigned long uvc_v4l2_get_unmapped_area(struct file *file,
struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;
- uvc_trace(stream->dev, UVC_TRACE_CALLS, "%s\n", __func__);
+ uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
return uvc_queue_get_unmapped_area(&stream->queue, pgoff);
}