Commit 0f089094 authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman

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: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 62bb84ed
This diff is collapsed.
...@@ -134,6 +134,7 @@ struct ci13xxx { ...@@ -134,6 +134,7 @@ struct ci13xxx {
struct dma_pool *td_pool; /* DMA pool for transfer descs */ struct dma_pool *td_pool; /* DMA pool for transfer descs */
struct usb_request *status; /* ep0 status request */ struct usb_request *status; /* ep0 status request */
struct device *dev;
struct usb_gadget gadget; /* USB slave device */ struct usb_gadget gadget; /* USB slave device */
struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */
u32 ep0_dir; /* ep0 direction */ u32 ep0_dir; /* ep0 direction */
...@@ -245,24 +246,18 @@ enum ci13xxx_regs { ...@@ -245,24 +246,18 @@ enum ci13xxx_regs {
/****************************************************************************** /******************************************************************************
* LOGGING * 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 #ifdef TRACE
#define trace(format, args...) ci13xxx_printk(KERN_DEBUG, format, ## args) #define trace(dev, format, args...) \
#define dbg_trace(format, args...) dev_dbg(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 #else
#define trace(format, args...) do {} while (0) #define trace(dev, format, args...) do {} while (0)
#define dbg_trace(format, args...) do {} while (0)
#endif #endif
#endif /* _CI13XXX_h_ */ #endif /* _CI13XXX_h_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment