diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 10:18:58 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 10:18:58 -0600 |
commit | 9a5382c33e63c2d36462f368657e87168fe5c3d8 (patch) | |
tree | 7480f45364d79730cad0eb4e74188a109da378ce /nuttx/drivers/usbdev | |
parent | fcb644c3ce3d4fc6eab79ccde3ed50f5ac4d1a7f (diff) | |
download | nuttx-9a5382c33e63c2d36462f368657e87168fe5c3d8.tar.gz nuttx-9a5382c33e63c2d36462f368657e87168fe5c3d8.tar.bz2 nuttx-9a5382c33e63c2d36462f368657e87168fe5c3d8.zip |
Update everything under nuttx/drivers to use the corrected syslog interfaces
Diffstat (limited to 'nuttx/drivers/usbdev')
-rw-r--r-- | nuttx/drivers/usbdev/usbdev_trace.c | 26 | ||||
-rw-r--r-- | nuttx/drivers/usbdev/usbmsc.h | 24 | ||||
-rw-r--r-- | nuttx/drivers/usbdev/usbmsc_scsi.c | 7 |
3 files changed, 28 insertions, 29 deletions
diff --git a/nuttx/drivers/usbdev/usbdev_trace.c b/nuttx/drivers/usbdev/usbdev_trace.c index f57cfbdc0..24f18fe5c 100644 --- a/nuttx/drivers/usbdev/usbdev_trace.c +++ b/nuttx/drivers/usbdev/usbdev_trace.c @@ -40,6 +40,7 @@ #include <nuttx/config.h> #include <sys/types.h> +#include <stdarg.h> #include <stdint.h> #include <errno.h> #include <debug.h> @@ -89,6 +90,26 @@ static usbtrace_idset_t g_maskedidset = CONFIG_USBDEV_TRACE_INITIALIDSET; ****************************************************************************/ /**************************************************************************** + * Name: usbtrace_syslog + ****************************************************************************/ + +#if !defined(CONFIG_USBDEV_TRACE) && \ + (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB)) +static int usbtrace_syslog(const char *fmt, ...) +{ + va_list ap; + int ret; + + /* Let lowvsyslog do the real work */ + + va_start(ap, fmt); + ret = lowvsyslog(LOG_INFO, fmt, ap); + va_end(ap); + return ret; +} +#endif + +/**************************************************************************** * Public Functions ****************************************************************************/ @@ -110,7 +131,8 @@ static usbtrace_idset_t g_maskedidset = CONFIG_USBDEV_TRACE_INITIALIDSET; * *******************************************************************************/ -#if defined(CONFIG_USBDEV_TRACE) || (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB)) +#if defined(CONFIG_USBDEV_TRACE) || \ + (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB)) usbtrace_idset_t usbtrace_enable(usbtrace_idset_t idset) { irqstate_t flags; @@ -170,7 +192,7 @@ void usbtrace(uint16_t event, uint16_t value) #else /* Just print the data using lowsyslog */ - usbtrace_trprintf((trprintf_t)lowsyslog, event, value); + usbtrace_trprintf(usbtrace_syslog, event, value); #endif } diff --git a/nuttx/drivers/usbdev/usbmsc.h b/nuttx/drivers/usbdev/usbmsc.h index 1fa8a83af..c98e275bc 100644 --- a/nuttx/drivers/usbdev/usbmsc.h +++ b/nuttx/drivers/usbdev/usbmsc.h @@ -204,30 +204,6 @@ # define CONFIG_USBMSC_SCSI_STACKSIZE 2048 #endif -/* Debug -- must be consistent with include/debug.h */ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# ifdef CONFIG_ARCH_LOWPUTC -# define dbgprintf(format, ...) lowsyslog(format, ##__VA_ARGS__) -# else -# define dbgprintf(format, ...) syslog(format, ##__VA_ARGS__) -# endif -# else -# define dbgprintf(x...) -# endif -#else -# ifdef CONFIG_DEBUG -# ifdef CONFIG_ARCH_LOWPUTC -# define dbgprintf lowsyslog -# else -# define dbgprintf syslog -# endif -# else -# define dbgprintf (void) -# endif -#endif - /* Packet and request buffer sizes */ #ifndef CONFIG_USBMSC_EP0MAXPACKET diff --git a/nuttx/drivers/usbdev/usbmsc_scsi.c b/nuttx/drivers/usbdev/usbmsc_scsi.c index 479d7ed9d..78ed8f42c 100644 --- a/nuttx/drivers/usbdev/usbmsc_scsi.c +++ b/nuttx/drivers/usbdev/usbmsc_scsi.c @@ -199,12 +199,13 @@ static void usbmsc_dumpdata(const char *msg, const uint8_t *buf, int buflen) { int i; - dbgprintf("%s:", msg); + lowsyslog(LOG_DEBUG, "%s:", msg); for (i = 0; i < buflen; i++) { - dbgprintf(" %02x", buf[i]); + lowsyslog(LOG_DEBUG, " %02x", buf[i]); } - dbgprintf("\n"); + + lowsyslog(LOG_DEBUG, "\n"); } #endif |