[U-Boot] [PATCH 3/8] USB-CDC: Linux-like debug printout
Sergei Shtylyov
sshtylyov at mvista.com
Thu Aug 12 19:01:55 CEST 2010
Hello.
Vitaly Kuzmichev wrote:
> Take debug printout macros back from linux-2.6.27 and make them more
> useful and more compatible.
> Signed-off-by: Vitaly Kuzmichev <vkuzmichev at mvista.com>
> ---
> drivers/usb/gadget/ether.c | 65 +++++++++++++++++++++++---------------------
> 1 files changed, 34 insertions(+), 31 deletions(-)
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index a07738f..b6f5f4d 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
[...]
> @@ -769,7 +771,7 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)
>
> result = usb_ep_enable (dev->status_ep, dev->status);
> if (result != 0) {
> - printf ("enable %s --> %d\n",
> + DEBUG (dev, "enable %s --> %d\n",
> dev->status_ep->name, result);
> goto done;
> }
> @@ -789,14 +791,14 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)
> if (!cdc_active(dev)) {
> result = usb_ep_enable (dev->in_ep, dev->in);
> if (result != 0) {
> - printf ("enable %s --> %d\n",
> + DEBUG(dev, "enable %s --> %d\n",
Well, I think the coding style shouldbe consistent -- you either leave the
space before ( or remove it. And as U-Boot seems to follow the Linux coding
style now, it seems better to remove the space.
> @@ -941,17 +945,17 @@ static void eth_status_complete (struct usb_ep *ep, struct usb_request *req)
>
> req->length = STATUS_BYTECOUNT;
> value = usb_ep_queue (ep, req, GFP_ATOMIC);
> - dprintf ("send SPEED_CHANGE --> %d\n", value);
> + DEBUG (dev, "send SPEED_CHANGE --> %d\n", value);
> if (value == 0)
> return;
> } else if (value != -ECONNRESET) {
> - dprintf("event %02x --> %d\n",
> + DEBUG (dev, "event %02x --> %d\n",
Why add a space where there was none before?
> @@ -1298,7 +1301,7 @@ fail:
>
> static void tx_complete (struct usb_ep *ep, struct usb_request *req)
> {
> - dprintf("%s, status: %s\n", __func__,(req->status) ? "failed":"ok");
> + VDEBUG(ep->driver_data,
No cast here?
> "%s: status %s\n", __func__, (req->status)?"failed":"ok");
> packet_sent=1;
> }
WBR, Sergei
More information about the U-Boot
mailing list