On Wed, May 28, 2014 at 11:34:04AM -0700, Greg Kroah-Hartman wrote:
> Now that the config option is gone, the driver needs to be converted
> over to using the dynamic_debug infrastructure, like all other USB
> drivers have been already.
> 
> Cc: "John W. Linville" <linvi...@tuxdriver.com>
> Cc: Christian Lamparter <chunk...@googlemail.com>
> Cc: Larry Finger <larry.fin...@lwfinger.net>
> Cc: Gertjan van Wingerde <gwinge...@gmail.com>
> Cc: Alexey Khoroshilov <khoroshi...@ispras.ru>
> Cc: Paul Gortmaker <paul.gortma...@windriver.com>
> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

Acked-by: John W. Linville <linvi...@tuxdriver.com>

> ---
>  drivers/net/wireless/orinoco/orinoco_usb.c | 50 
> +++++++++++-------------------
>  1 file changed, 18 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c 
> b/drivers/net/wireless/orinoco/orinoco_usb.c
> index f9805c9353d2..3ac71339d040 100644
> --- a/drivers/net/wireless/orinoco/orinoco_usb.c
> +++ b/drivers/net/wireless/orinoco/orinoco_usb.c
> @@ -100,25 +100,11 @@ static struct ez_usb_fw firmware = {
>       .code = NULL,
>  };
>  
> -#ifdef CONFIG_USB_DEBUG
> -static int debug = 1;
> -#else
> -static int debug;
> -#endif
> -
>  /* Debugging macros */
> -#undef dbg
> -#define dbg(format, arg...) \
> -     do { if (debug) printk(KERN_DEBUG PFX "%s: " format "\n", \
> -                            __func__ , ## arg); } while (0)
>  #undef err
>  #define err(format, arg...) \
>       do { printk(KERN_ERR PFX format "\n", ## arg); } while (0)
>  
> -/* Module paramaters */
> -module_param(debug, int, 0644);
> -MODULE_PARM_DESC(debug, "Debug enabled or not");
> -
>  MODULE_FIRMWARE("orinoco_ezusb_fw");
>  
>  /*
> @@ -341,7 +327,7 @@ static void ezusb_request_timerfn(u_long _ctx)
>               ctx->state = EZUSB_CTX_REQ_TIMEOUT;
>       } else {
>               ctx->state = EZUSB_CTX_RESP_TIMEOUT;
> -             dbg("couldn't unlink");
> +             dev_dbg(&ctx->outurb->dev->dev, "couldn't unlink\n");
>               atomic_inc(&ctx->refcount);
>               ctx->killed = 1;
>               ezusb_ctx_complete(ctx);
> @@ -634,9 +620,9 @@ static void ezusb_request_in_callback(struct ezusb_priv 
> *upriv,
>                               ctx = c;
>                               break;
>                       }
> -                     dbg("Skipped (0x%x/0x%x) (%d/%d)",
> -                         le16_to_cpu(ans->hermes_rid),
> -                         c->in_rid, ans->ans_reply_count, reply_count);
> +                     netdev_dbg(upriv->dev, "Skipped (0x%x/0x%x) (%d/%d)\n",
> +                                le16_to_cpu(ans->hermes_rid), c->in_rid,
> +                                ans->ans_reply_count, reply_count);
>               }
>       }
>  
> @@ -768,7 +754,7 @@ static int ezusb_submit_in_urb(struct ezusb_priv *upriv)
>       void *cur_buf = upriv->read_urb->transfer_buffer;
>  
>       if (upriv->read_urb->status == -EINPROGRESS) {
> -             dbg("urb busy, not resubmiting");
> +             netdev_dbg(upriv->dev, "urb busy, not resubmiting\n");
>               retval = -EBUSY;
>               goto exit;
>       }
> @@ -838,8 +824,9 @@ static int ezusb_firmware_download(struct ezusb_priv 
> *upriv,
>               memcpy(fw_buffer, &fw->code[addr], FW_BUF_SIZE);
>               if (variant_offset >= addr &&
>                   variant_offset < addr + FW_BUF_SIZE) {
> -                     dbg("Patching card_variant byte at 0x%04X",
> -                         variant_offset);
> +                     netdev_dbg(upriv->dev,
> +                                "Patching card_variant byte at 0x%04X\n",
> +                                variant_offset);
>                       fw_buffer[variant_offset - addr] = FW_VAR_VALUE;
>               }
>               retval = usb_control_msg(upriv->udev,
> @@ -879,7 +866,6 @@ static int ezusb_access_ltv(struct ezusb_priv *upriv,
>       BUG_ON(in_irq());
>  
>       if (!upriv->udev) {
> -             dbg("Device disconnected");
>               retval = -ENODEV;
>               goto exit;
>       }
> @@ -1023,8 +1009,9 @@ static int ezusb_doicmd_wait(struct hermes *hw, u16 
> cmd, u16 parm0, u16 parm1,
>               cpu_to_le16(parm1),
>               cpu_to_le16(parm2),
>       };
> -     dbg("0x%04X, parm0 0x%04X, parm1 0x%04X, parm2 0x%04X",
> -         cmd, parm0, parm1, parm2);
> +     netdev_dbg(upriv->dev,
> +                "0x%04X, parm0 0x%04X, parm1 0x%04X, parm2 0x%04X\n", cmd,
> +                parm0, parm1, parm2);
>       ctx = ezusb_alloc_ctx(upriv, EZUSB_RID_DOCMD, EZUSB_RID_ACK);
>       if (!ctx)
>               return -ENOMEM;
> @@ -1045,7 +1032,7 @@ static int ezusb_docmd_wait(struct hermes *hw, u16 cmd, 
> u16 parm0,
>               0,
>               0,
>       };
> -     dbg("0x%04X, parm0 0x%04X", cmd, parm0);
> +     netdev_dbg(upriv->dev, "0x%04X, parm0 0x%04X\n", cmd, parm0);
>       ctx = ezusb_alloc_ctx(upriv, EZUSB_RID_DOCMD, EZUSB_RID_ACK);
>       if (!ctx)
>               return -ENOMEM;
> @@ -1332,7 +1319,7 @@ static int ezusb_hard_reset(struct orinoco_private 
> *priv)
>               return retval;
>       }
>  
> -     dbg("sending control message");
> +     netdev_dbg(upriv->dev, "sending control message\n");
>       retval = usb_control_msg(upriv->udev,
>                                usb_sndctrlpipe(upriv->udev, 0),
>                                EZUSB_REQUEST_TRIGER,
> @@ -1401,10 +1388,8 @@ static void ezusb_bulk_in_callback(struct urb *urb)
>       u16 crc;
>       u16 hermes_rid;
>  
> -     if (upriv->udev == NULL) {
> -             dbg("disconnected");
> +     if (upriv->udev == NULL)
>               return;
> -     }
>  
>       if (urb->status == -ETIMEDOUT) {
>               /* When a device gets unplugged we get this every time
> @@ -1421,12 +1406,13 @@ static void ezusb_bulk_in_callback(struct urb *urb)
>       if ((urb->status == -EILSEQ)
>           || (urb->status == -ENOENT)
>           || (urb->status == -ECONNRESET)) {
> -             dbg("status %d, not resubmiting", urb->status);
> +             netdev_dbg(upriv->dev, "status %d, not resubmiting\n",
> +                        urb->status);
>               return;
>       }
>       if (urb->status)
> -             dbg("status: %d length: %d",
> -                 urb->status, urb->actual_length);
> +             netdev_dbg(upriv->dev, "status: %d length: %d\n",
> +                        urb->status, urb->actual_length);
>       if (urb->actual_length < sizeof(*ans)) {
>               err("%s: short read, ignoring", __func__);
>               goto resubmit;
> -- 
> 1.9.0
> 
> 

-- 
John W. Linville                Someday the world will need a hero, and you
linvi...@tuxdriver.com                  might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to