Commit 68a49a4a authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[media] ttusb-budget: driver has a debug param, use it

Remove DEBUG define, key debug spew off of the module's debug param that
already exists.
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2faa0ca8
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
my TTUSB, so let it undef'd unless you want to implement another my TTUSB, so let it undef'd unless you want to implement another
frontend. never tested. frontend. never tested.
DEBUG: debug:
define it to > 3 for really hardcore debugging. you probably don't want define it to > 3 for really hardcore debugging. you probably don't want
this unless the device doesn't load at all. > 2 for bandwidth statistics. this unless the device doesn't load at all. > 2 for bandwidth statistics.
*/ */
...@@ -134,20 +134,19 @@ struct ttusb { ...@@ -134,20 +134,19 @@ struct ttusb {
/* ugly workaround ... don't know why it's necessary to read */ /* ugly workaround ... don't know why it's necessary to read */
/* all result codes. */ /* all result codes. */
#define DEBUG 0
static int ttusb_cmd(struct ttusb *ttusb, static int ttusb_cmd(struct ttusb *ttusb,
const u8 * data, int len, int needresult) const u8 * data, int len, int needresult)
{ {
int actual_len; int actual_len;
int err; int err;
#if DEBUG >= 3
int i; int i;
printk(">"); if (debug >= 3) {
for (i = 0; i < len; ++i) printk(KERN_DEBUG ">");
printk(" %02x", data[i]); for (i = 0; i < len; ++i)
printk("\n"); printk(KERN_CONT " %02x", data[i]);
#endif printk(KERN_CONT "\n");
}
if (mutex_lock_interruptible(&ttusb->semusb) < 0) if (mutex_lock_interruptible(&ttusb->semusb) < 0)
return -EAGAIN; return -EAGAIN;
...@@ -176,13 +175,15 @@ static int ttusb_cmd(struct ttusb *ttusb, ...@@ -176,13 +175,15 @@ static int ttusb_cmd(struct ttusb *ttusb,
mutex_unlock(&ttusb->semusb); mutex_unlock(&ttusb->semusb);
return err; return err;
} }
#if DEBUG >= 3
actual_len = ttusb->last_result[3] + 4; if (debug >= 3) {
printk("<"); actual_len = ttusb->last_result[3] + 4;
for (i = 0; i < actual_len; ++i) printk(KERN_DEBUG "<");
printk(" %02x", ttusb->last_result[i]); for (i = 0; i < actual_len; ++i)
printk("\n"); printk(KERN_CONT " %02x", ttusb->last_result[i]);
#endif printk(KERN_CONT "\n");
}
if (!needresult) if (!needresult)
mutex_unlock(&ttusb->semusb); mutex_unlock(&ttusb->semusb);
return 0; return 0;
...@@ -636,16 +637,13 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len) ...@@ -636,16 +637,13 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
++ttusb->mux_state; ++ttusb->mux_state;
else { else {
ttusb->mux_state = 0; ttusb->mux_state = 0;
#if DEBUG > 3
if (ttusb->insync)
printk("%02x ", data[-1]);
#else
if (ttusb->insync) { if (ttusb->insync) {
printk("%s: lost sync.\n", dprintk("%s: %02x\n",
__func__, data[-1]);
printk(KERN_INFO "%s: lost sync.\n",
__func__); __func__);
ttusb->insync = 0; ttusb->insync = 0;
} }
#endif
} }
break; break;
case 3: case 3:
...@@ -744,6 +742,9 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len) ...@@ -744,6 +742,9 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
static void ttusb_iso_irq(struct urb *urb) static void ttusb_iso_irq(struct urb *urb)
{ {
struct ttusb *ttusb = urb->context; struct ttusb *ttusb = urb->context;
struct usb_iso_packet_descriptor *d;
u8 *data;
int len, i;
if (!ttusb->iso_streaming) if (!ttusb->iso_streaming)
return; return;
...@@ -755,21 +756,14 @@ static void ttusb_iso_irq(struct urb *urb) ...@@ -755,21 +756,14 @@ static void ttusb_iso_irq(struct urb *urb)
#endif #endif
if (!urb->status) { if (!urb->status) {
int i;
for (i = 0; i < urb->number_of_packets; ++i) { for (i = 0; i < urb->number_of_packets; ++i) {
struct usb_iso_packet_descriptor *d;
u8 *data;
int len;
numpkt++; numpkt++;
if (time_after_eq(jiffies, lastj + HZ)) { if (time_after_eq(jiffies, lastj + HZ)) {
#if DEBUG > 2 dprintk("frames/s: %lu (ts: %d, stuff %d, "
printk "sec: %d, invalid: %d, all: %d)\n",
("frames/s: %d (ts: %d, stuff %d, sec: %d, invalid: %d, all: %d)\n", numpkt * HZ / (jiffies - lastj),
numpkt * HZ / (jiffies - lastj), numts, numstuff, numsec, numinvalid,
numts, numstuff, numsec, numinvalid, numts + numstuff + numsec + numinvalid);
numts + numstuff + numsec +
numinvalid);
#endif
numts = numstuff = numsec = numinvalid = 0; numts = numstuff = numsec = numinvalid = 0;
lastj = jiffies; lastj = jiffies;
numpkt = 0; numpkt = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment