diff options
| author | Joe Perches <joe@perches.com> | 2012-09-12 23:13:37 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-17 09:10:05 -0400 |
| commit | 05e4e5b87aab74f994acf9dd4bed4a8f1367cd09 (patch) | |
| tree | e40c6ba66ea821556abbf73a71fa8b55ef73cb63 /include | |
| parent | c2c5a7051c556036b7beb8f4a89eefdc91c3245b (diff) | |
dev: Add dev_vprintk_emit and dev_printk_emit
Add utility functions to consolidate the use of
create_syslog_header and vprintk_emit.
This allows conversion of logging functions that
call create_syslog_header and then call vprintk_emit
or printk_emit to the dev_ equivalents.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: David S. Miller <davem@davemloft.net>
Tested-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/device.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index a1443b48ed4b..0d9ba0c09791 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -897,6 +897,10 @@ extern const char *dev_driver_string(const struct device *dev); | |||
| 897 | 897 | ||
| 898 | extern int create_syslog_header(const struct device *dev, | 898 | extern int create_syslog_header(const struct device *dev, |
| 899 | char *hdr, size_t hdrlen); | 899 | char *hdr, size_t hdrlen); |
| 900 | extern int dev_vprintk_emit(int level, const struct device *dev, | ||
| 901 | const char *fmt, va_list args); | ||
| 902 | extern __printf(3, 4) | ||
| 903 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); | ||
| 900 | 904 | ||
| 901 | extern __printf(3, 4) | 905 | extern __printf(3, 4) |
| 902 | int dev_printk(const char *level, const struct device *dev, | 906 | int dev_printk(const char *level, const struct device *dev, |
| @@ -918,6 +922,13 @@ int _dev_info(const struct device *dev, const char *fmt, ...); | |||
| 918 | 922 | ||
| 919 | #else | 923 | #else |
| 920 | 924 | ||
| 925 | static int dev_vprintk_emit(int level, const struct device *dev, | ||
| 926 | const char *fmt, va_list args) | ||
| 927 | { return 0; } | ||
| 928 | static inline __printf(3, 4) | ||
| 929 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) | ||
| 930 | { return 0; } | ||
| 931 | |||
| 921 | static inline int __dev_printk(const char *level, const struct device *dev, | 932 | static inline int __dev_printk(const char *level, const struct device *dev, |
| 922 | struct va_format *vaf) | 933 | struct va_format *vaf) |
| 923 | { return 0; } | 934 | { return 0; } |
