[media] v4l2-ioctl: remove v4l_(i2c_)print_ioctl
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 22 Jun 2012 09:38:06 +0000 (06:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 6 Jul 2012 20:26:46 +0000 (17:26 -0300)
v4l_i2c_print_ioctl wasn't used and v4l_print_ioctl could be replaced by
v4l_printk_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/sn9c102/sn9c102.h
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/v4l2-ioctl.c
include/media/v4l2-ioctl.h

index cbe40806bd7123c557b88eebea2d4cd18cea2044..f344aed32a936cdcfcfd93c45c4ae377c79bdb7d 100644 (file)
@@ -957,7 +957,7 @@ static long pvr2_v4l2_ioctl(struct file *file,
        long ret = -EINVAL;
 
        if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL)
-               v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw), cmd);
+               v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd);
 
        if (!pvr2_hdw_dev_ok(hdw)) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
@@ -990,7 +990,7 @@ static long pvr2_v4l2_ioctl(struct file *file,
                                pvr2_trace(PVR2_TRACE_V4LIOCTL,
                                           "pvr2_v4l2_do_ioctl failure, ret=%ld"
                                           " command was:", ret);
-                               v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),
+                               v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw),
                                                cmd);
                        }
                }
index 22ea211ab54f144cfb656c2080a17896c93d9538..2bc153e869befb7ab21df85ce809e2f0fde5efe9 100644 (file)
@@ -182,7 +182,7 @@ do {                                                                          \
 #      define V4LDBG(level, name, cmd)                                       \
 do {                                                                          \
        if (debug >= (level))                                                 \
-               v4l_print_ioctl(name, cmd);                                   \
+               v4l_printk_ioctl(name, cmd);                                  \
 } while (0)
 #      define KDBG(level, fmt, args...)                                      \
 do {                                                                          \
index 759bef8897e9d9d4645d837a451b2b2c96fee92d..f00db3060e0e36e005b306a53f393cc55071b101 100644 (file)
@@ -1051,7 +1051,7 @@ static long uvc_v4l2_ioctl(struct file *file,
 {
        if (uvc_trace_param & UVC_TRACE_IOCTL) {
                uvc_printk(KERN_DEBUG, "uvc_v4l2_ioctl(");
-               v4l_printk_ioctl(cmd);
+               v4l_printk_ioctl(NULL, cmd);
                printk(")\n");
        }
 
index 273c6d7bef65336dfa51a5df29faa26b6bba0729..fd6436edde70aa421334869d1f7ff059612bc3bc 100644 (file)
 #include <media/v4l2-device.h>
 #include <media/v4l2-chip-ident.h>
 
-#define dbgarg(cmd, fmt, arg...) \
-               do {                                                    \
-                   if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) {            \
-                       printk(KERN_DEBUG "%s: ",  vfd->name);          \
-                       v4l_printk_ioctl(cmd);                          \
-                       printk(" " fmt,  ## arg);                       \
-                   }                                                   \
-               } while (0)
-
-#define dbgarg2(fmt, arg...) \
-               do {                                                    \
-                   if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)              \
-                       printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\
-               } while (0)
-
-#define dbgarg3(fmt, arg...) \
-               do {                                                    \
-                   if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)              \
-                       printk(KERN_CONT "%s: " fmt, vfd->name, ## arg);\
-               } while (0)
-
 /* Zero out the end of the struct pointed to by p.  Everything after, but
  * not including, the specified field is cleared. */
 #define CLEAR_AFTER_FIELD(p, field) \
@@ -1956,10 +1935,13 @@ bool v4l2_is_known_ioctl(unsigned int cmd)
 
 /* Common ioctl debug function. This function can be used by
    external ioctl messages as well as internal V4L ioctl */
-void v4l_printk_ioctl(unsigned int cmd)
+void v4l_printk_ioctl(const char *prefix, unsigned int cmd)
 {
        const char *dir, *type;
 
+       if (prefix)
+               printk(KERN_DEBUG "%s: ", prefix);
+
        switch (_IOC_TYPE(cmd)) {
        case 'd':
                type = "v4l2_int";
@@ -2003,8 +1985,8 @@ static long __video_do_ioctl(struct file *file,
        long ret = -ENOTTY;
 
        if (ops == NULL) {
-               printk(KERN_WARNING "videodev: \"%s\" has no ioctl_ops.\n",
-                               vfd->name);
+               pr_warn("%s: has no ioctl_ops.\n",
+                               video_device_node_name(vfd));
                return ret;
        }
 
@@ -2034,7 +2016,7 @@ static long __video_do_ioctl(struct file *file,
 
        write_only = _IOC_DIR(cmd) == _IOC_WRITE;
        if (write_only && debug > V4L2_DEBUG_IOCTL) {
-               v4l_print_ioctl(vfd->name, cmd);
+               v4l_printk_ioctl(video_device_node_name(vfd), cmd);
                pr_cont(": ");
                info->debug(arg, write_only);
        }
@@ -2062,7 +2044,7 @@ done:
                                        video_device_node_name(vfd), ret);
                        return ret;
                }
-               v4l_print_ioctl(vfd->name, cmd);
+               v4l_printk_ioctl(video_device_node_name(vfd), cmd);
                if (ret < 0)
                        pr_cont(": error %ld\n", ret);
                else if (debug == V4L2_DEBUG_IOCTL)
index d8b76f7392f8d793c6abdf0a2a1a46b53fa115bc..dfd984f10d42a9437bab5c387733ed5276d43e21 100644 (file)
@@ -295,28 +295,14 @@ struct v4l2_ioctl_ops {
 #define V4L2_DEBUG_IOCTL     0x01
 #define V4L2_DEBUG_IOCTL_ARG 0x02
 
-/* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */
-#define v4l_print_ioctl(name, cmd)              \
-       do {                                     \
-               printk(KERN_DEBUG "%s: ", name); \
-               v4l_printk_ioctl(cmd);           \
-       } while (0)
-
-/* Use this macro in I2C drivers where 'client' is the struct i2c_client
-   pointer */
-#define v4l_i2c_print_ioctl(client, cmd)                  \
-       do {                                               \
-               v4l_client_printk(KERN_DEBUG, client, ""); \
-               v4l_printk_ioctl(cmd);                     \
-       } while (0)
-
 /*  Video standard functions  */
 extern const char *v4l2_norm_to_name(v4l2_std_id id);
 extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod);
 extern int v4l2_video_std_construct(struct v4l2_standard *vs,
                                    int id, const char *name);
-/* Prints the ioctl in a human-readable format */
-extern void v4l_printk_ioctl(unsigned int cmd);
+/* Prints the ioctl in a human-readable format. If prefix != NULL,
+   then do printk(KERN_DEBUG "%s: ", prefix) first. */
+extern void v4l_printk_ioctl(const char *prefix, unsigned int cmd);
 
 /* names for fancy debug output */
 extern const char *v4l2_field_names[];