summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-09-12 20:13:37 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-17 06:10:05 -0700
commit05e4e5b87aab74f994acf9dd4bed4a8f1367cd09 (patch)
treee40c6ba66ea821556abbf73a71fa8b55ef73cb63 /include/linux/device.h
parentc2c5a7051c556036b7beb8f4a89eefdc91c3245b (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/linux/device.h')
-rw-r--r--include/linux/device.h11
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);
extern int create_syslog_header(const struct device *dev,
char *hdr, size_t hdrlen);
+extern int dev_vprintk_emit(int level, const struct device *dev,
+ const char *fmt, va_list args);
+extern __printf(3, 4)
+int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
extern __printf(3, 4)
int dev_printk(const char *level, const struct device *dev,
@@ -918,6 +922,13 @@ int _dev_info(const struct device *dev, const char *fmt, ...);
#else
+static int dev_vprintk_emit(int level, const struct device *dev,
+ const char *fmt, va_list args)
+{ return 0; }
+static inline __printf(3, 4)
+int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
+{ return 0; }
+
static inline int __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf)
{ return 0; }