From 0f089094cde53a2639c965cd3bd3fdef27006446 Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Tue, 8 May 2012 23:29:02 +0300 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/ci13xxx_udc.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'drivers/usb/gadget/ci13xxx_udc.h') 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_ */ -- cgit v1.2.3