device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit

Convert direct calls of vprintk_emit and printk_emit to the
dev_ equivalents.

Make create_syslog_header static.

Signed-off-by: Joe Perches <[email protected]>
Acked-by: David S. Miller <[email protected]>
Tested-by: Jim Cromie <[email protected]>
Acked-by: Jason Baron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Joe Perches 2012-09-12 20:14:11 -07:00 • committed by Greg Kroah-Hartman
commit 666f355f38
4 changed files with 22 additions and 41 deletions

View file

@ -1865,7 +1865,8 @@ void device_shutdown(void)
*/
#ifdef CONFIG_PRINTK
int create_syslog_header(const struct device *dev, char *hdr, size_t hdrlen)
static int
create_syslog_header(const struct device *dev, char *hdr, size_t hdrlen)
{
const char *subsys;
size_t pos = 0;
@ -1943,17 +1944,12 @@ EXPORT_SYMBOL(dev_printk_emit);
static int __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf)
{
char hdr[128];
size_t hdrlen;
if (!dev)
return printk("%s(NULL device *): %pV", level, vaf);
hdrlen = create_syslog_header(dev, hdr, sizeof(hdr));
return printk_emit(0, level[1] - '0', hdrlen ? hdr : NULL, hdrlen,
"%s %s: %pV",
dev_driver_string(dev), dev_name(dev), vaf);
return dev_printk_emit(level[1] - '0', dev,
"%s %s: %pV",
dev_driver_string(dev), dev_name(dev), vaf);
}
int dev_printk(const char *level, const struct device *dev,