After this patch, the actual dwc3 driver doesn't need dev_dbg(). After a couple more patches on glue layers, we will be able to remove CONFIG_DWC3_DEBUG and rely solely on tracepoints for our debugging. Signed-off-by: Felipe Balbi <balbi@xxxxxx> --- drivers/usb/dwc3/core.c | 8 +++++--- drivers/usb/dwc3/ep0.c | 4 ++-- drivers/usb/dwc3/gadget.c | 41 +++++++++++++++++++++++++++-------------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 5c110d8e293b..80dff84c224a 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -245,7 +245,8 @@ static int dwc3_event_buffers_setup(struct dwc3 *dwc) for (n = 0; n < dwc->num_event_buffers; n++) { evt = dwc->ev_buffs[n]; - dev_dbg(dwc->dev, "Event buf %p dma %08llx length %d\n", + dwc3_trace(trace_dwc3_core, + "Event buf %p dma %08llx length %d", evt->buf, (unsigned long long) evt->dma, evt->length); @@ -572,12 +573,13 @@ static int dwc3_core_init(struct dwc3 *dwc) reg |= DWC3_GCTL_GBLHIBERNATIONEN; break; default: - dev_dbg(dwc->dev, "No power optimization available\n"); + dwc3_trace(trace_dwc3_core, + "No power optimization available"); } /* check if current dwc3 is on simulation board */ if (dwc->hwparams.hwparams6 & DWC3_GHWPARAMS6_EN_FPGA) { - dev_dbg(dwc->dev, "it is on FPGA board\n"); + dwc3_trace(trace_dwc3_core, "it is on FPGA board"); dwc->is_fpga = true; } diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 2ef3c8d6a9db..b8bf71634118 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -933,7 +933,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, ret = usb_gadget_map_request(&dwc->gadget, &req->request, dep->number); if (ret) { - dev_dbg(dwc->dev, "failed to map request\n"); + dwc3_trace(trace_dwc3_ep0, "failed to map request"); return; } @@ -956,7 +956,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, ret = usb_gadget_map_request(&dwc->gadget, &req->request, dep->number); if (ret) { - dev_dbg(dwc->dev, "failed to map request\n"); + dwc3_trace(trace_dwc3_ep0, "failed to map request"); return; } diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 333a7c0078fc..c4915a095240 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -265,7 +265,8 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, usb_gadget_unmap_request(&dwc->gadget, &req->request, req->direction); - dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", + dwc3_trace(trace_dwc3_gadget, + "request %p from %s completed %d/%d ===> %d", req, dep->name, req->request.actual, req->request.length, status); trace_dwc3_gadget_giveback(req); @@ -984,7 +985,8 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, cmd |= DWC3_DEPCMD_PARAM(cmd_param); ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, ¶ms); if (ret < 0) { - dev_dbg(dwc->dev, "failed to send STARTTRANSFER command\n"); + dwc3_trace(trace_dwc3_gadget, + "failed to send STARTTRANSFER command"); /* * FIXME we need to iterate over the list of requests @@ -1095,7 +1097,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) ret = __dwc3_gadget_kick_transfer(dep, 0, true); if (ret && ret != -EBUSY) - dev_dbg(dwc->dev, "%s: failed to kick transfers\n", + dwc3_trace(trace_dwc3_gadget, + "%s: failed to kick transfers", dep->name); return ret; } @@ -1112,7 +1115,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) ret = __dwc3_gadget_kick_transfer(dep, dep->resource_index, false); if (ret && ret != -EBUSY) - dev_dbg(dwc->dev, "%s: failed to kick transfers\n", + dwc3_trace(trace_dwc3_gadget, + "%s: failed to kick transfers", dep->name); return ret; } @@ -1125,7 +1129,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) if (dep->stream_capable) { ret = __dwc3_gadget_kick_transfer(dep, 0, true); if (ret && ret != -EBUSY) - dev_dbg(dwc->dev, "%s: failed to kick transfers\n", + dwc3_trace(trace_dwc3_gadget, + "%s: failed to kick transfers", dep->name); } @@ -1145,7 +1150,8 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request, spin_lock_irqsave(&dwc->lock, flags); if (!dep->endpoint.desc) { - dev_dbg(dwc->dev, "trying to queue request %p to disabled %s\n", + dwc3_trace(trace_dwc3_gadget, + "trying to queue request %p to disabled %s", request, ep->name); ret = -ESHUTDOWN; goto out; @@ -1231,7 +1237,8 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol) if (!protocol && ((dep->direction && dep->flags & DWC3_EP_BUSY) || (!list_empty(&dep->req_queued) || !list_empty(&dep->request_list)))) { - dev_dbg(dwc->dev, "%s: pending request, cannot halt\n", + dwc3_trace(trace_dwc3_gadget, + "%s: pending request, cannot halt\n", dep->name); return -EAGAIN; } @@ -1358,7 +1365,7 @@ static int dwc3_gadget_wakeup(struct usb_gadget *g) speed = reg & DWC3_DSTS_CONNECTSPD; if (speed == DWC3_DSTS_SUPERSPEED) { - dev_dbg(dwc->dev, "no wakeup on SuperSpeed\n"); + dwc3_trace(trace_dwc3_gadget, "no wakeup on SuperSpeed"); ret = -EINVAL; goto out; } @@ -1370,7 +1377,8 @@ static int dwc3_gadget_wakeup(struct usb_gadget *g) case DWC3_LINK_STATE_U3: /* in HS, means SUSPEND */ break; default: - dev_dbg(dwc->dev, "can't wakeup from link state %d\n", + dwc3_trace(trace_dwc3_gadget, + "can't wakeup from link state %d", link_state); ret = -EINVAL; goto out; @@ -1799,7 +1807,8 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep, if (count) { trb_status = DWC3_TRB_SIZE_TRBSTS(trb->size); if (trb_status == DWC3_TRBSTS_MISSED_ISOC) { - dev_dbg(dwc->dev, "incomplete IN transfer %s\n", + dwc3_trace(trace_dwc3_gadget, + "incomplete IN transfer %s", dep->name); /* * If missed isoc occurred and there is @@ -1965,7 +1974,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, dep->resource_index = 0; if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { - dev_dbg(dwc->dev, "%s is an Isochronous endpoint\n", + dwc3_trace(trace_dwc3_gadget, + "%s is an Isochronous endpoint", dep->name); return; } @@ -1991,7 +2001,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, if (!ret || ret == -EBUSY) return; - dev_dbg(dwc->dev, "%s: failed to kick transfers\n", + dwc3_trace(trace_dwc3_gadget, + "%s: failed to kick transfers", dep->name); } @@ -2013,11 +2024,13 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, case DEPEVT_STREAMEVT_NOTFOUND: /* FALLTHROUGH */ default: - dev_dbg(dwc->dev, "Couldn't find suitable stream\n"); + dwc3_trace(trace_dwc3_gadget, + "Couldn't find suitable stream"); } break; case DWC3_DEPEVT_RXTXFIFOEVT: - dev_dbg(dwc->dev, "%s FIFO Overrun\n", dep->name); + dwc3_trace(trace_dwc3_gadget, + "%s FIFO Overrun", dep->name); break; case DWC3_DEPEVT_EPCMDCMPLT: dwc3_trace(trace_dwc3_gadget, "Endpoint Command Complete"); -- 2.4.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html