In preparation to cleanup the debug logic, simplify the dev_debug
usage. In particular, make sure that a single flag is used to
control each debug print.

Before this commit V4L2_DEV_DEBUG_STREAMING and V4L2_DEV_DEBUG_FOP
were needed to enable read and write debugging. After this commit
only the former is needed.

Signed-off-by: Ezequiel Garcia <ezequ...@collabora.com>
---
 drivers/media/v4l2-core/v4l2-dev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-dev.c 
b/drivers/media/v4l2-core/v4l2-dev.c
index d7528f82a66a..34e4958663bf 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -315,8 +315,7 @@ static ssize_t v4l2_read(struct file *filp, char __user 
*buf,
                return -EINVAL;
        if (video_is_registered(vdev))
                ret = vdev->fops->read(filp, buf, sz, off);
-       if ((vdev->dev_debug & V4L2_DEV_DEBUG_FOP) &&
-           (vdev->dev_debug & V4L2_DEV_DEBUG_STREAMING))
+       if (vdev->dev_debug & V4L2_DEV_DEBUG_STREAMING)
                dprintk("%s: read: %zd (%d)\n",
                        video_device_node_name(vdev), sz, ret);
        return ret;
@@ -332,8 +331,7 @@ static ssize_t v4l2_write(struct file *filp, const char 
__user *buf,
                return -EINVAL;
        if (video_is_registered(vdev))
                ret = vdev->fops->write(filp, buf, sz, off);
-       if ((vdev->dev_debug & V4L2_DEV_DEBUG_FOP) &&
-           (vdev->dev_debug & V4L2_DEV_DEBUG_STREAMING))
+       if (vdev->dev_debug & V4L2_DEV_DEBUG_STREAMING)
                dprintk("%s: write: %zd (%d)\n",
                        video_device_node_name(vdev), sz, ret);
        return ret;
-- 
2.20.1

Reply via email to