diff options
author | Joe Perches <joe@perches.com> | 2011-08-21 18:56:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-03 19:54:14 -0400 |
commit | 44d0b80e5ff741d502a6ccc8685a18bda1ac9da4 (patch) | |
tree | b19473bcfeae86f0ab4ccc66e5bf18fea71fc896 /include/media/saa7146.h | |
parent | 0b8bd83cf393832f1d00096b866d888b75b374c3 (diff) |
[media] saa7146: Use current logging styles
Standardize the mechanisms to emit logging messages.
A few other modules used an #include from saa7146,
convert those at the same time.
Add pr_fmt.
Convert printks to pr_<level>
Convert printks without KERN_<level> to appropriate pr_<level>.
Convert logging macros requiring multiple parentheses to normal style.
Removed embedded prefixes when pr_fmt was added.
Whitespace cleanups when around other conversions.
Use printf extension %pM to print mac address.
Coalesce format strings.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Michael Hunold <michael@mihu.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/saa7146.h')
-rw-r--r-- | include/media/saa7146.h | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 79827143d5ac..5017500eda1b 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -25,24 +25,32 @@ | |||
25 | 25 | ||
26 | extern unsigned int saa7146_debug; | 26 | extern unsigned int saa7146_debug; |
27 | 27 | ||
28 | //#define DEBUG_PROLOG printk("(0x%08x)(0x%08x) %s: %s(): ",(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,RPS_ADDR0))),(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,IER))),KBUILD_MODNAME,__func__) | ||
29 | |||
30 | #ifndef DEBUG_VARIABLE | 28 | #ifndef DEBUG_VARIABLE |
31 | #define DEBUG_VARIABLE saa7146_debug | 29 | #define DEBUG_VARIABLE saa7146_debug |
32 | #endif | 30 | #endif |
33 | 31 | ||
34 | #define DEBUG_PROLOG printk("%s: %s(): ",KBUILD_MODNAME, __func__) | 32 | #define ERR(fmt, ...) pr_err("%s: " fmt, __func__, ##__VA_ARGS__) |
35 | #define INFO(x) { printk("%s: ",KBUILD_MODNAME); printk x; } | 33 | |
36 | 34 | #define _DBG(mask, fmt, ...) \ | |
37 | #define ERR(x) { DEBUG_PROLOG; printk x; } | 35 | do { \ |
38 | 36 | if (DEBUG_VARIABLE & mask) \ | |
39 | #define DEB_S(x) if (0!=(DEBUG_VARIABLE&0x01)) { DEBUG_PROLOG; printk x; } /* simple debug messages */ | 37 | pr_debug("%s(): " fmt, __func__, ##__VA_ARGS__); \ |
40 | #define DEB_D(x) if (0!=(DEBUG_VARIABLE&0x02)) { DEBUG_PROLOG; printk x; } /* more detailed debug messages */ | 38 | } while (0) |
41 | #define DEB_EE(x) if (0!=(DEBUG_VARIABLE&0x04)) { DEBUG_PROLOG; printk x; } /* print enter and exit of functions */ | 39 | |
42 | #define DEB_I2C(x) if (0!=(DEBUG_VARIABLE&0x08)) { DEBUG_PROLOG; printk x; } /* i2c debug messages */ | 40 | /* simple debug messages */ |
43 | #define DEB_VBI(x) if (0!=(DEBUG_VARIABLE&0x10)) { DEBUG_PROLOG; printk x; } /* vbi debug messages */ | 41 | #define DEB_S(fmt, ...) _DBG(0x01, fmt, ##__VA_ARGS__) |
44 | #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ | 42 | /* more detailed debug messages */ |
45 | #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ | 43 | #define DEB_D(fmt, ...) _DBG(0x02, fmt, ##__VA_ARGS__) |
44 | /* print enter and exit of functions */ | ||
45 | #define DEB_EE(fmt, ...) _DBG(0x04, fmt, ##__VA_ARGS__) | ||
46 | /* i2c debug messages */ | ||
47 | #define DEB_I2C(fmt, ...) _DBG(0x08, fmt, ##__VA_ARGS__) | ||
48 | /* vbi debug messages */ | ||
49 | #define DEB_VBI(fmt, ...) _DBG(0x10, fmt, ##__VA_ARGS__) | ||
50 | /* interrupt debug messages */ | ||
51 | #define DEB_INT(fmt, ...) _DBG(0x20, fmt, ##__VA_ARGS__) | ||
52 | /* capture debug messages */ | ||
53 | #define DEB_CAP(fmt, ...) _DBG(0x40, fmt, ##__VA_ARGS__) | ||
46 | 54 | ||
47 | #define SAA7146_ISR_CLEAR(x,y) \ | 55 | #define SAA7146_ISR_CLEAR(x,y) \ |
48 | saa7146_write(x, ISR, (y)); | 56 | saa7146_write(x, ISR, (y)); |