diff options
author | Theodore Kilgore <kilgota@banach.math.auburn.edu> | 2013-02-04 20:17:55 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-05 22:13:48 +0400 |
commit | c93396e13576928a073154b5715761ff8a998368 (patch) | |
tree | 2ef9873a27412fe6d5dbe361d7298301510573f6 /drivers/media/usb/gspca/gspca.h | |
parent | 70c8ecf54bf735f300f86bde562420af90bf9db4 (diff) | |
download | linux-c93396e13576928a073154b5715761ff8a998368.tar.xz |
[media] gspca: Remove gspca-specific debug magic
Instead use v4l2_dbg and v4l2_err. Note that the PDEBUG macro is kept to
make this patch-set less invasive, but it is simply a wrapper around
v4l2_dbg now. Most of the other changes are there to make the dev parameter
for the v4l2_xxx macros available everywhere we do logging.
Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/gspca/gspca.h')
-rw-r--r-- | drivers/media/usb/gspca/gspca.h | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/drivers/media/usb/gspca/gspca.h b/drivers/media/usb/gspca/gspca.h index ac62cd3b590e..c3af3212d51e 100644 --- a/drivers/media/usb/gspca/gspca.h +++ b/drivers/media/usb/gspca/gspca.h @@ -10,30 +10,26 @@ #include <media/v4l2-device.h> #include <linux/mutex.h> -/* compilation option */ -/*#define GSPCA_DEBUG 1*/ -#ifdef GSPCA_DEBUG -/* GSPCA our debug messages */ + +/* GSPCA debug codes */ + +#define D_PROBE 1 +#define D_CONF 2 +#define D_STREAM 3 +#define D_FRAM 4 +#define D_PACK 5 +#define D_USBI 6 +#define D_USBO 7 + extern int gspca_debug; -#define PDEBUG(level, fmt, ...) \ -do { \ - if (gspca_debug & (level)) \ - pr_info(fmt, ##__VA_ARGS__); \ -} while (0) - -#define D_ERR 0x01 -#define D_PROBE 0x02 -#define D_CONF 0x04 -#define D_STREAM 0x08 -#define D_FRAM 0x10 -#define D_PACK 0x20 -#define D_USBI 0x00 -#define D_USBO 0x00 -#define D_V4L2 0x0100 -#else -#define PDEBUG(level, fmt, ...) do {} while(0) -#endif + + +#define PDEBUG(level, fmt, ...) \ + v4l2_dbg(level, gspca_debug, &gspca_dev->v4l2_dev, fmt, ##__VA_ARGS__) + +#define PERR(fmt, ...) \ + v4l2_err(&gspca_dev->v4l2_dev, fmt, ##__VA_ARGS__) #define GSPCA_MAX_FRAMES 16 /* maximum number of video frame buffers */ /* image transfers */ |