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>
struct usb_gadget *gadget = &udc->gadget;
int n = 0;
struct usb_gadget *gadget = &udc->gadget;
int n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
struct usb_gadget_driver *driver = udc->driver;
int n = 0;
struct usb_gadget_driver *driver = udc->driver;
int n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
dev_err(dev, "[%s] EINVAL\n", __func__);
return 0;
if (attr == NULL || buf == NULL) {
dev_err(dev, "[%s] EINVAL\n", __func__);
return 0;
unsigned long flags;
unsigned i, j, n = 0;
unsigned long flags;
unsigned i, j, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(dev->parent, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(dev->parent, "[%s] EINVAL\n", __func__);
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(dev->parent, "[%s] %p, %d\n", __func__, buf, count);
if (attr == NULL || buf == NULL) {
dev_err(dev, "[%s] EINVAL\n", __func__);
goto done;
if (attr == NULL || buf == NULL) {
dev_err(dev, "[%s] EINVAL\n", __func__);
goto done;
u32 intr;
unsigned i, j, n = 0;
u32 intr;
unsigned i, j, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
unsigned long flags;
unsigned en, bit;
unsigned long flags;
unsigned en, bit;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(udc->dev, "%p, %d\n", buf, count);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "EINVAL\n");
goto done;
}
if (sscanf(buf, "%u %u", &en, &bit) != 2 || en > 1) {
goto done;
}
if (sscanf(buf, "%u %u", &en, &bit) != 2 || en > 1) {
- dev_err(dev, "<1|0> <bit>: enable|disable interrupt");
+ dev_err(udc->dev, "<1|0> <bit>: enable|disable interrupt\n");
unsigned long flags;
unsigned mode;
unsigned long flags;
unsigned mode;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "EINVAL\n");
unsigned long flags;
unsigned mode;
unsigned long flags;
unsigned mode;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(udc->dev, "%p, %d\n", buf, count);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
goto done;
}
if (sscanf(buf, "%u", &mode) != 1) {
goto done;
}
if (sscanf(buf, "%u", &mode) != 1) {
- dev_err(dev, "<mode>: set port test mode");
+ dev_err(udc->dev, "<mode>: set port test mode");
goto done;
}
spin_lock_irqsave(&udc->lock, flags);
if (hw_port_test_set(udc, mode))
goto done;
}
spin_lock_irqsave(&udc->lock, flags);
if (hw_port_test_set(udc, mode))
- dev_err(dev, "invalid mode\n");
+ dev_err(udc->dev, "invalid mode\n");
spin_unlock_irqrestore(&udc->lock, flags);
done:
spin_unlock_irqrestore(&udc->lock, flags);
done:
unsigned long flags;
unsigned i, j, n = 0;
unsigned long flags;
unsigned i, j, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
u32 *dump;
unsigned i, k, n = 0;
u32 *dump;
unsigned i, k, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
return 0;
}
dump = kmalloc(sizeof(u32) * DUMP_ENTRIES, GFP_KERNEL);
if (!dump) {
return 0;
}
dump = kmalloc(sizeof(u32) * DUMP_ENTRIES, GFP_KERNEL);
if (!dump) {
- dev_err(dev, "%s: out of memory\n", __func__);
+ dev_err(udc->dev, "%s: out of memory\n", __func__);
struct ci13xxx *udc = container_of(dev, struct ci13xxx, gadget.dev);
unsigned long addr, data, flags;
struct ci13xxx *udc = container_of(dev, struct ci13xxx, gadget.dev);
unsigned long addr, data, flags;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(udc->dev, "%p, %d\n", buf, count);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
goto done;
}
if (sscanf(buf, "%li %li", &addr, &data) != 2) {
goto done;
}
if (sscanf(buf, "%li %li", &addr, &data) != 2) {
- dev_err(dev, "<addr> <data>: write data to register address");
+ dev_err(udc->dev,
+ "<addr> <data>: write data to register address\n");
goto done;
}
spin_lock_irqsave(&udc->lock, flags);
if (hw_register_write(udc, addr, data))
goto done;
}
spin_lock_irqsave(&udc->lock, flags);
if (hw_register_write(udc, addr, data))
- dev_err(dev, "invalid address range\n");
+ dev_err(udc->dev, "invalid address range\n");
spin_unlock_irqrestore(&udc->lock, flags);
done:
spin_unlock_irqrestore(&udc->lock, flags);
done:
struct ci13xxx_req *req = NULL;
unsigned i, j, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32);
struct ci13xxx_req *req = NULL;
unsigned i, j, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32);
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
int ret = 0;
unsigned length = mReq->req.length;
int ret = 0;
unsigned length = mReq->req.length;
- trace("%p, %p", mEp, mReq);
+ trace(udc->dev, "%p, %p", mEp, mReq);
/* don't queue twice */
if (mReq->req.status == -EALREADY)
/* don't queue twice */
if (mReq->req.status == -EALREADY)
*/
static int _hardware_dequeue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
{
*/
static int _hardware_dequeue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
{
- trace("%p, %p", mEp, mReq);
+ trace(mEp->udc->dev, "%p, %p", mEp, mReq);
if (mReq->req.status != -EALREADY)
return -EINVAL;
if (mReq->req.status != -EALREADY)
return -EINVAL;
__releases(mEp->lock)
__acquires(mEp->lock)
{
__releases(mEp->lock)
__acquires(mEp->lock)
{
+ trace(mEp->udc->dev, "%p", mEp);
if (mEp == NULL)
return -EINVAL;
if (mEp == NULL)
return -EINVAL;
struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget);
unsigned long flags;
struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget);
unsigned long flags;
+ trace(udc->dev, "%p", gadget);
if (gadget == NULL)
return -EINVAL;
if (gadget == NULL)
return -EINVAL;
- trace("%p", udc);
-
- if (udc == NULL) {
- pr_err("EINVAL\n");
- return;
- }
+ trace(udc->dev, "%p", udc);
dbg_event(0xFF, "BUS RST", 0);
dbg_event(0xFF, "BUS RST", 0);
- pr_err("error: %i\n", retval);
+ dev_err(udc->dev, "error: %i\n", retval);
*/
static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req)
{
*/
static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req)
{
- trace("%p, %p", ep, req);
+ trace(NULL, "%p, %p", ep, req);
- if (ep == NULL || req == NULL) {
- pr_err("EINVAL\n");
+ if (ep == NULL || req == NULL)
kfree(req->buf);
usb_ep_free_request(ep, req);
kfree(req->buf);
usb_ep_free_request(ep, req);
gfp_t gfp_flags = GFP_ATOMIC;
int dir, num, retval;
gfp_t gfp_flags = GFP_ATOMIC;
int dir, num, retval;
- trace("%p, %p", mEp, setup);
+ trace(udc->dev, "%p, %p", mEp, setup);
if (mEp == NULL || setup == NULL)
return -EINVAL;
if (mEp == NULL || setup == NULL)
return -EINVAL;
struct ci13xxx *udc = req->context;
unsigned long flags;
struct ci13xxx *udc = req->context;
unsigned long flags;
- trace("%p, %p", ep, req);
+ trace(udc->dev, "%p, %p", ep, req);
spin_lock_irqsave(&udc->lock, flags);
if (udc->test_mode)
spin_lock_irqsave(&udc->lock, flags);
if (udc->test_mode)
int retval;
struct ci13xxx_ep *mEp;
int retval;
struct ci13xxx_ep *mEp;
+ trace(udc->dev, "%p", udc);
mEp = (udc->ep0_dir == TX) ? udc->ep0out : udc->ep0in;
udc->status->context = udc;
mEp = (udc->ep0_dir == TX) ? udc->ep0out : udc->ep0in;
udc->status->context = udc;
struct ci13xxx_ep *mEpTemp = mEp;
int uninitialized_var(retval);
struct ci13xxx_ep *mEpTemp = mEp;
int uninitialized_var(retval);
+ trace(mEp->udc->dev, "%p", mEp);
if (list_empty(&mEp->qh.queue))
return -EINVAL;
if (list_empty(&mEp->qh.queue))
return -EINVAL;
unsigned i;
u8 tmode = 0;
unsigned i;
u8 tmode = 0;
- trace("%p", udc);
-
- if (udc == NULL) {
- pr_err("EINVAL\n");
- return;
- }
+ trace(udc->dev, "%p", udc);
for (i = 0; i < udc->hw_ep_max; i++) {
struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
for (i = 0; i < udc->hw_ep_max; i++) {
struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
"ERROR", err);
spin_unlock(&udc->lock);
if (usb_ep_set_halt(&mEp->ep))
"ERROR", err);
spin_unlock(&udc->lock);
if (usb_ep_set_halt(&mEp->ep))
- dev_err(&udc->gadget.dev,
"error: ep_set_halt\n");
spin_lock(&udc->lock);
}
"error: ep_set_halt\n");
spin_lock(&udc->lock);
}
- dev_warn(&udc->gadget.dev,
- "ctrl traffic received at endpoint\n");
+ dev_warn(udc->dev, "ctrl traffic at endpoint %d\n", i);
spin_unlock(&udc->lock);
if (usb_ep_set_halt(&mEp->ep))
spin_unlock(&udc->lock);
if (usb_ep_set_halt(&mEp->ep))
- dev_err(&udc->gadget.dev,
- "error: ep_set_halt\n");
+ dev_err(udc->dev, "error: ep_set_halt\n");
spin_lock(&udc->lock);
}
}
spin_lock(&udc->lock);
}
}
int retval = 0;
unsigned long flags;
int retval = 0;
unsigned long flags;
- trace("%p, %p", ep, desc);
+ trace(mEp->udc->dev, "%p, %p", ep, desc);
if (ep == NULL || desc == NULL)
return -EINVAL;
if (ep == NULL || desc == NULL)
return -EINVAL;
mEp->ep.desc = desc;
if (!list_empty(&mEp->qh.queue))
mEp->ep.desc = desc;
if (!list_empty(&mEp->qh.queue))
- warn("enabling a non-empty endpoint!");
+ dev_warn(mEp->udc->dev, "enabling a non-empty endpoint!\n");
mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX;
mEp->num = usb_endpoint_num(desc);
mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX;
mEp->num = usb_endpoint_num(desc);
int direction, retval = 0;
unsigned long flags;
int direction, retval = 0;
unsigned long flags;
+ trace(mEp->udc->dev, "%p", ep);
if (ep == NULL)
return -EINVAL;
if (ep == NULL)
return -EINVAL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
struct ci13xxx_req *mReq = NULL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
struct ci13xxx_req *mReq = NULL;
- trace("%p, %i", ep, gfp_flags);
+ trace(mEp->udc->dev, "%p, %i", ep, gfp_flags);
- if (ep == NULL) {
- pr_err("EINVAL\n");
mReq = kzalloc(sizeof(struct ci13xxx_req), gfp_flags);
if (mReq != NULL) {
mReq = kzalloc(sizeof(struct ci13xxx_req), gfp_flags);
if (mReq != NULL) {
struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req);
unsigned long flags;
struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req);
unsigned long flags;
- trace("%p, %p", ep, req);
+ trace(mEp->udc->dev, "%p, %p", ep, req);
if (ep == NULL || req == NULL) {
if (ep == NULL || req == NULL) {
return;
} else if (!list_empty(&mReq->queue)) {
return;
} else if (!list_empty(&mReq->queue)) {
+ dev_err(mEp->udc->dev, "freeing queued request\n");
int retval = 0;
unsigned long flags;
int retval = 0;
unsigned long flags;
- trace("%p, %p, %X", ep, req, gfp_flags);
+ trace(mEp->udc->dev, "%p, %p, %X", ep, req, gfp_flags);
if (ep == NULL || req == NULL || mEp->ep.desc == NULL)
return -EINVAL;
if (ep == NULL || req == NULL || mEp->ep.desc == NULL)
return -EINVAL;
if (!list_empty(&mEp->qh.queue)) {
_ep_nuke(mEp);
retval = -EOVERFLOW;
if (!list_empty(&mEp->qh.queue)) {
_ep_nuke(mEp);
retval = -EOVERFLOW;
- warn("endpoint ctrl %X nuked", _usb_addr(mEp));
+ dev_warn(mEp->udc->dev, "endpoint ctrl %X nuked\n",
+ _usb_addr(mEp));
}
}
/* first nuke then test link, e.g. previous status has not sent */
if (!list_empty(&mReq->queue)) {
retval = -EBUSY;
}
}
/* first nuke then test link, e.g. previous status has not sent */
if (!list_empty(&mReq->queue)) {
retval = -EBUSY;
- pr_err("request already in queue\n");
+ dev_err(mEp->udc->dev, "request already in queue\n");
goto done;
}
if (req->length > 4 * CI13XXX_PAGE_SIZE) {
req->length = 4 * CI13XXX_PAGE_SIZE;
retval = -EMSGSIZE;
goto done;
}
if (req->length > 4 * CI13XXX_PAGE_SIZE) {
req->length = 4 * CI13XXX_PAGE_SIZE;
retval = -EMSGSIZE;
- warn("request length truncated");
+ dev_warn(mEp->udc->dev, "request length truncated\n");
}
dbg_queue(_usb_addr(mEp), req, retval);
}
dbg_queue(_usb_addr(mEp), req, retval);
struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req);
unsigned long flags;
struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req);
unsigned long flags;
- trace("%p, %p", ep, req);
+ trace(mEp->udc->dev, "%p, %p", ep, req);
if (ep == NULL || req == NULL || mReq->req.status != -EALREADY ||
mEp->ep.desc == NULL || list_empty(&mReq->queue) ||
if (ep == NULL || req == NULL || mReq->req.status != -EALREADY ||
mEp->ep.desc == NULL || list_empty(&mReq->queue) ||
int direction, retval = 0;
unsigned long flags;
int direction, retval = 0;
unsigned long flags;
- trace("%p, %i", ep, value);
+ trace(mEp->udc->dev, "%p, %i", ep, value);
if (ep == NULL || mEp->ep.desc == NULL)
return -EINVAL;
if (ep == NULL || mEp->ep.desc == NULL)
return -EINVAL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
unsigned long flags;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
unsigned long flags;
+ trace(mEp->udc->dev, "%p", ep);
if (ep == NULL || mEp->ep.desc == NULL)
return -EINVAL;
if (ep == NULL || mEp->ep.desc == NULL)
return -EINVAL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
unsigned long flags;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
unsigned long flags;
+ trace(mEp->udc->dev, "%p", ep);
- pr_err("%02X: -EINVAL\n", _usb_addr(mEp));
+ dev_err(mEp->udc->dev, "%02X: -EINVAL\n", _usb_addr(mEp));
unsigned long flags;
int ret = 0;
unsigned long flags;
int ret = 0;
spin_lock_irqsave(&udc->lock, flags);
if (!udc->remote_wakeup) {
ret = -EOPNOTSUPP;
spin_lock_irqsave(&udc->lock, flags);
if (!udc->remote_wakeup) {
ret = -EOPNOTSUPP;
- trace("remote wakeup feature is not enabled\n");
+ trace(udc->dev, "remote wakeup feature is not enabled\n");
goto out;
}
if (!hw_read(udc, OP_PORTSC, PORTSC_SUSP)) {
ret = -EINVAL;
goto out;
}
if (!hw_read(udc, OP_PORTSC, PORTSC_SUSP)) {
ret = -EINVAL;
- trace("port is not suspended\n");
+ trace(udc->dev, "port is not suspended\n");
goto out;
}
hw_write(udc, OP_PORTSC, PORTSC_FPR, PORTSC_FPR);
goto out;
}
hw_write(udc, OP_PORTSC, PORTSC_FPR, PORTSC_FPR);
int i, j;
int retval = -ENOMEM;
int i, j;
int retval = -ENOMEM;
+ trace(udc->dev, "%p", driver);
if (driver == NULL ||
bind == NULL ||
if (driver == NULL ||
bind == NULL ||
spin_lock_irqsave(&udc->lock, flags);
spin_lock_irqsave(&udc->lock, flags);
- info("hw_ep_max = %d", udc->hw_ep_max);
+ dev_info(udc->dev, "hw_ep_max = %d\n", udc->hw_ep_max);
udc->gadget.dev.driver = NULL;
udc->gadget.dev.driver = NULL;
struct ci13xxx *udc = _udc;
unsigned long i, flags;
struct ci13xxx *udc = _udc;
unsigned long i, flags;
+ trace(udc->dev, "%p", driver);
if (driver == NULL ||
driver->unbind == NULL ||
if (driver == NULL ||
driver->unbind == NULL ||
irqreturn_t retval;
u32 intr;
irqreturn_t retval;
u32 intr;
+ trace(udc ? udc->dev : NULL, "");
+ dev_err(udc->dev, "ENODEV");
*/
static void udc_release(struct device *dev)
{
*/
static void udc_release(struct device *dev)
{
- trace("%p", dev);
-
- if (dev == NULL)
- pr_err("EINVAL\n");
+ trace(dev->parent, "%p", dev);
struct ci13xxx *udc;
int retval = 0;
struct ci13xxx *udc;
int retval = 0;
- trace("%p, %p, %p", dev, regs, driver->name);
+ trace(dev, "%p, %p, %p", dev, regs, driver->name);
if (dev == NULL || regs == NULL || driver == NULL ||
driver->name == NULL)
if (dev == NULL || regs == NULL || driver == NULL ||
driver->name == NULL)
udc->gadget.dev.parent = dev;
udc->gadget.dev.release = udc_release;
udc->gadget.dev.parent = dev;
udc->gadget.dev.release = udc_release;
retval = hw_device_init(udc, regs, driver->capoffset);
if (retval < 0)
goto free_udc;
retval = hw_device_init(udc, regs, driver->capoffset);
if (retval < 0)
goto free_udc;
{
struct ci13xxx *udc = _udc;
{
struct ci13xxx *udc = _udc;
- if (udc == NULL) {
- pr_err("EINVAL\n");
usb_del_gadget_udc(&udc->gadget);
if (udc->transceiver) {
usb_del_gadget_udc(&udc->gadget);
if (udc->transceiver) {
struct dma_pool *td_pool; /* DMA pool for transfer descs */
struct usb_request *status; /* ep0 status request */
struct dma_pool *td_pool; /* DMA pool for transfer descs */
struct usb_request *status; /* ep0 status request */
struct usb_gadget gadget; /* USB slave device */
struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */
u32 ep0_dir; /* ep0 direction */
struct usb_gadget gadget; /* USB slave device */
struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */
u32 ep0_dir; /* ep0 direction */
/******************************************************************************
* 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)
-
-#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)
-#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_ */
#endif
#endif /* _CI13XXX_h_ */