aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-09-12 23:13:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-17 09:10:05 -0400
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);
897 897
898extern int create_syslog_header(const struct device *dev, 898extern int create_syslog_header(const struct device *dev,
899 char *hdr, size_t hdrlen); 899 char *hdr, size_t hdrlen);
900extern int dev_vprintk_emit(int level, const struct device *dev,
901 const char *fmt, va_list args);
902extern __printf(3, 4)
903int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
900 904
901extern __printf(3, 4) 905extern __printf(3, 4)
902int dev_printk(const char *level, const struct device *dev, 906int 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
925static int dev_vprintk_emit(int level, const struct device *dev,
926 const char *fmt, va_list args)
927{ return 0; }
928static inline __printf(3, 4)
929int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
930{ return 0; }
931
921static inline int __dev_printk(const char *level, const struct device *dev, 932static 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; }