Skip to content

Commit

Permalink
USB: orinoco_usb: remove CONFIG_USB_DEBUG support
Browse files Browse the repository at this point in the history
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: Christian Lamparter <chunkeey@googlemail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Greg Kroah-Hartman committed May 29, 2014
1 parent cf24df6 commit 70d2f61
Showing 1 changed file with 18 additions and 32 deletions.
50 changes: 18 additions & 32 deletions drivers/net/wireless/orinoco/orinoco_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

/*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 70d2f61

Please sign in to comment.