summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/ci13xxx_udc.h
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2012-05-09 00:29:02 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 02:00:26 +0400
commit0f089094cde53a2639c965cd3bd3fdef27006446 (patch)
treed5637886cb65cd949fc2388fefcd52b387e27da1 /drivers/usb/gadget/ci13xxx_udc.h
parent62bb84ed0e4d14b0a5070f44b2387a42f7f535d9 (diff)
downloadlinux-0f089094cde53a2639c965cd3bd3fdef27006446.tar.xz
usb: gadget: ci13xxx: replace home-brewed logging with dev_{err,warn,info}
Logging output in the driver is mostly done using custom err/warn/info macros which rely on the existence of the global variable _udc, which is a global reference to the udc controller structure. This reference will have to go in order to allow us to have more than one chipidea udc in the system. Thus, replace custom macros with dev_{err,warn,info} using the platform device where possible. The trace() macro, which is a nop by default is left for tracing purposes. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/ci13xxx_udc.h')
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/gadget/ci13xxx_udc.h
index f605090777ce..a12fa569315f 100644
--- a/drivers/usb/gadget/ci13xxx_udc.h
+++ b/drivers/usb/gadget/ci13xxx_udc.h
@@ -134,6 +134,7 @@ struct ci13xxx {
struct dma_pool *td_pool; /* DMA pool for transfer descs */
struct usb_request *status; /* ep0 status request */
+ struct device *dev;
struct usb_gadget gadget; /* USB slave device */
struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */
u32 ep0_dir; /* ep0 direction */
@@ -245,24 +246,18 @@ enum ci13xxx_regs {
/******************************************************************************
* LOGGING
*****************************************************************************/
-#define ci13xxx_printk(level, format, args...) \
-do { \
- if (_udc == NULL) \
- printk(level "[%s] " format "\n", __func__, ## args); \
- else \
- dev_printk(level, _udc->gadget.dev.parent, \
- "[%s] " format "\n", __func__, ## args); \
-} while (0)
-
-#define warn(format, args...) ci13xxx_printk(KERN_WARNING, format, ## args)
-#define info(format, args...) ci13xxx_printk(KERN_INFO, format, ## args)
-
#ifdef TRACE
-#define trace(format, args...) ci13xxx_printk(KERN_DEBUG, format, ## args)
-#define dbg_trace(format, args...) dev_dbg(dev, format, ##args)
+#define trace(dev, format, args...) \
+ do { \
+ if (dev == NULL) \
+ pr_debug("[%s] " format "\n", __func__, \
+ ## args); \
+ else \
+ dev_printk(KERN_DEBUG, dev, "[%s] " format "\n", \
+ __func__, ## args); \
+ } while (0)
#else
-#define trace(format, args...) do {} while (0)
-#define dbg_trace(format, args...) do {} while (0)
+#define trace(dev, format, args...) do {} while (0)
#endif
#endif /* _CI13XXX_h_ */