diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-06-22 05:38:06 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-06 16:26:46 -0400 |
commit | 4a085168b59ec0fb18eb7fa023dcc47f4db14655 (patch) | |
tree | 7714bce24858460f6cb6ca03254752d3adc28360 | |
parent | 80131fe06e0bdd7b429594493c1317ddede89a61 (diff) |
[media] v4l2-ioctl: remove v4l_(i2c_)print_ioctl
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>
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 4 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102.h | 2 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 2 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 34 | ||||
-rw-r--r-- | include/media/v4l2-ioctl.h | 20 |
5 files changed, 15 insertions, 47 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index cbe40806bd71..f344aed32a93 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | |||
@@ -957,7 +957,7 @@ static long pvr2_v4l2_ioctl(struct file *file, | |||
957 | long ret = -EINVAL; | 957 | long ret = -EINVAL; |
958 | 958 | ||
959 | if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) | 959 | if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) |
960 | v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw), cmd); | 960 | v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd); |
961 | 961 | ||
962 | if (!pvr2_hdw_dev_ok(hdw)) { | 962 | if (!pvr2_hdw_dev_ok(hdw)) { |
963 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | 963 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
@@ -990,7 +990,7 @@ static long pvr2_v4l2_ioctl(struct file *file, | |||
990 | pvr2_trace(PVR2_TRACE_V4LIOCTL, | 990 | pvr2_trace(PVR2_TRACE_V4LIOCTL, |
991 | "pvr2_v4l2_do_ioctl failure, ret=%ld" | 991 | "pvr2_v4l2_do_ioctl failure, ret=%ld" |
992 | " command was:", ret); | 992 | " command was:", ret); |
993 | v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw), | 993 | v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), |
994 | cmd); | 994 | cmd); |
995 | } | 995 | } |
996 | } | 996 | } |
diff --git a/drivers/media/video/sn9c102/sn9c102.h b/drivers/media/video/sn9c102/sn9c102.h index 22ea211ab54f..2bc153e869be 100644 --- a/drivers/media/video/sn9c102/sn9c102.h +++ b/drivers/media/video/sn9c102/sn9c102.h | |||
@@ -182,7 +182,7 @@ do { \ | |||
182 | # define V4LDBG(level, name, cmd) \ | 182 | # define V4LDBG(level, name, cmd) \ |
183 | do { \ | 183 | do { \ |
184 | if (debug >= (level)) \ | 184 | if (debug >= (level)) \ |
185 | v4l_print_ioctl(name, cmd); \ | 185 | v4l_printk_ioctl(name, cmd); \ |
186 | } while (0) | 186 | } while (0) |
187 | # define KDBG(level, fmt, args...) \ | 187 | # define KDBG(level, fmt, args...) \ |
188 | do { \ | 188 | do { \ |
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index 759bef8897e9..f00db3060e0e 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c | |||
@@ -1051,7 +1051,7 @@ static long uvc_v4l2_ioctl(struct file *file, | |||
1051 | { | 1051 | { |
1052 | if (uvc_trace_param & UVC_TRACE_IOCTL) { | 1052 | if (uvc_trace_param & UVC_TRACE_IOCTL) { |
1053 | uvc_printk(KERN_DEBUG, "uvc_v4l2_ioctl("); | 1053 | uvc_printk(KERN_DEBUG, "uvc_v4l2_ioctl("); |
1054 | v4l_printk_ioctl(cmd); | 1054 | v4l_printk_ioctl(NULL, cmd); |
1055 | printk(")\n"); | 1055 | printk(")\n"); |
1056 | } | 1056 | } |
1057 | 1057 | ||
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 273c6d7bef65..fd6436edde70 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -28,27 +28,6 @@ | |||
28 | #include <media/v4l2-device.h> | 28 | #include <media/v4l2-device.h> |
29 | #include <media/v4l2-chip-ident.h> | 29 | #include <media/v4l2-chip-ident.h> |
30 | 30 | ||
31 | #define dbgarg(cmd, fmt, arg...) \ | ||
32 | do { \ | ||
33 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \ | ||
34 | printk(KERN_DEBUG "%s: ", vfd->name); \ | ||
35 | v4l_printk_ioctl(cmd); \ | ||
36 | printk(" " fmt, ## arg); \ | ||
37 | } \ | ||
38 | } while (0) | ||
39 | |||
40 | #define dbgarg2(fmt, arg...) \ | ||
41 | do { \ | ||
42 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ | ||
43 | printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ | ||
44 | } while (0) | ||
45 | |||
46 | #define dbgarg3(fmt, arg...) \ | ||
47 | do { \ | ||
48 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ | ||
49 | printk(KERN_CONT "%s: " fmt, vfd->name, ## arg);\ | ||
50 | } while (0) | ||
51 | |||
52 | /* Zero out the end of the struct pointed to by p. Everything after, but | 31 | /* Zero out the end of the struct pointed to by p. Everything after, but |
53 | * not including, the specified field is cleared. */ | 32 | * not including, the specified field is cleared. */ |
54 | #define CLEAR_AFTER_FIELD(p, field) \ | 33 | #define CLEAR_AFTER_FIELD(p, field) \ |
@@ -1956,10 +1935,13 @@ bool v4l2_is_known_ioctl(unsigned int cmd) | |||
1956 | 1935 | ||
1957 | /* Common ioctl debug function. This function can be used by | 1936 | /* Common ioctl debug function. This function can be used by |
1958 | external ioctl messages as well as internal V4L ioctl */ | 1937 | external ioctl messages as well as internal V4L ioctl */ |
1959 | void v4l_printk_ioctl(unsigned int cmd) | 1938 | void v4l_printk_ioctl(const char *prefix, unsigned int cmd) |
1960 | { | 1939 | { |
1961 | const char *dir, *type; | 1940 | const char *dir, *type; |
1962 | 1941 | ||
1942 | if (prefix) | ||
1943 | printk(KERN_DEBUG "%s: ", prefix); | ||
1944 | |||
1963 | switch (_IOC_TYPE(cmd)) { | 1945 | switch (_IOC_TYPE(cmd)) { |
1964 | case 'd': | 1946 | case 'd': |
1965 | type = "v4l2_int"; | 1947 | type = "v4l2_int"; |
@@ -2003,8 +1985,8 @@ static long __video_do_ioctl(struct file *file, | |||
2003 | long ret = -ENOTTY; | 1985 | long ret = -ENOTTY; |
2004 | 1986 | ||
2005 | if (ops == NULL) { | 1987 | if (ops == NULL) { |
2006 | printk(KERN_WARNING "videodev: \"%s\" has no ioctl_ops.\n", | 1988 | pr_warn("%s: has no ioctl_ops.\n", |
2007 | vfd->name); | 1989 | video_device_node_name(vfd)); |
2008 | return ret; | 1990 | return ret; |
2009 | } | 1991 | } |
2010 | 1992 | ||
@@ -2034,7 +2016,7 @@ static long __video_do_ioctl(struct file *file, | |||
2034 | 2016 | ||
2035 | write_only = _IOC_DIR(cmd) == _IOC_WRITE; | 2017 | write_only = _IOC_DIR(cmd) == _IOC_WRITE; |
2036 | if (write_only && debug > V4L2_DEBUG_IOCTL) { | 2018 | if (write_only && debug > V4L2_DEBUG_IOCTL) { |
2037 | v4l_print_ioctl(vfd->name, cmd); | 2019 | v4l_printk_ioctl(video_device_node_name(vfd), cmd); |
2038 | pr_cont(": "); | 2020 | pr_cont(": "); |
2039 | info->debug(arg, write_only); | 2021 | info->debug(arg, write_only); |
2040 | } | 2022 | } |
@@ -2062,7 +2044,7 @@ done: | |||
2062 | video_device_node_name(vfd), ret); | 2044 | video_device_node_name(vfd), ret); |
2063 | return ret; | 2045 | return ret; |
2064 | } | 2046 | } |
2065 | v4l_print_ioctl(vfd->name, cmd); | 2047 | v4l_printk_ioctl(video_device_node_name(vfd), cmd); |
2066 | if (ret < 0) | 2048 | if (ret < 0) |
2067 | pr_cont(": error %ld\n", ret); | 2049 | pr_cont(": error %ld\n", ret); |
2068 | else if (debug == V4L2_DEBUG_IOCTL) | 2050 | else if (debug == V4L2_DEBUG_IOCTL) |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index d8b76f7392f8..dfd984f10d42 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -295,28 +295,14 @@ struct v4l2_ioctl_ops { | |||
295 | #define V4L2_DEBUG_IOCTL 0x01 | 295 | #define V4L2_DEBUG_IOCTL 0x01 |
296 | #define V4L2_DEBUG_IOCTL_ARG 0x02 | 296 | #define V4L2_DEBUG_IOCTL_ARG 0x02 |
297 | 297 | ||
298 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ | ||
299 | #define v4l_print_ioctl(name, cmd) \ | ||
300 | do { \ | ||
301 | printk(KERN_DEBUG "%s: ", name); \ | ||
302 | v4l_printk_ioctl(cmd); \ | ||
303 | } while (0) | ||
304 | |||
305 | /* Use this macro in I2C drivers where 'client' is the struct i2c_client | ||
306 | pointer */ | ||
307 | #define v4l_i2c_print_ioctl(client, cmd) \ | ||
308 | do { \ | ||
309 | v4l_client_printk(KERN_DEBUG, client, ""); \ | ||
310 | v4l_printk_ioctl(cmd); \ | ||
311 | } while (0) | ||
312 | |||
313 | /* Video standard functions */ | 298 | /* Video standard functions */ |
314 | extern const char *v4l2_norm_to_name(v4l2_std_id id); | 299 | extern const char *v4l2_norm_to_name(v4l2_std_id id); |
315 | extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod); | 300 | extern void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod); |
316 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, | 301 | extern int v4l2_video_std_construct(struct v4l2_standard *vs, |
317 | int id, const char *name); | 302 | int id, const char *name); |
318 | /* Prints the ioctl in a human-readable format */ | 303 | /* Prints the ioctl in a human-readable format. If prefix != NULL, |
319 | extern void v4l_printk_ioctl(unsigned int cmd); | 304 | then do printk(KERN_DEBUG "%s: ", prefix) first. */ |
305 | extern void v4l_printk_ioctl(const char *prefix, unsigned int cmd); | ||
320 | 306 | ||
321 | /* names for fancy debug output */ | 307 | /* names for fancy debug output */ |
322 | extern const char *v4l2_field_names[]; | 308 | extern const char *v4l2_field_names[]; |