Commit 0a3b8b64 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Greg Kroah-Hartman

Staging: comedi: usbduxfast: add comedi debug to Kconfig

This patch moves CONFIG_COMEDI_DEBUG to Kconfig and cleans up the code
as it didn't actually compile with debug enabled.
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Bernd Porr <BerndPorr@f2s.com>
Cc: David Schleef <ds@schleef.org>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6fffdb35
...@@ -6,6 +6,13 @@ config COMEDI ...@@ -6,6 +6,13 @@ config COMEDI
Enable support a wide range of data acquision devices Enable support a wide range of data acquision devices
for Linux. for Linux.
config COMEDI_DEBUG
bool "Comedi debugging"
depends on COMEDI != n
help
This is an option for use by developers; most people should
say N here. This enables comedi core and driver debugging.
config COMEDI_RT config COMEDI_RT
tristate "Comedi Real-time support" tristate "Comedi Real-time support"
depends on COMEDI && RT depends on COMEDI && RT
......
...@@ -59,10 +59,6 @@ Status: testing ...@@ -59,10 +59,6 @@ Status: testing
#include "comedi_fc.h" #include "comedi_fc.h"
#include "../comedidev.h" #include "../comedidev.h"
// (un)comment this if you want to have debug info.
//#define CONFIG_COMEDI_DEBUG
#undef CONFIG_COMEDI_DEBUG
#define BOARDNAME "usbduxfast" #define BOARDNAME "usbduxfast"
// timeout for the USB-transfer // timeout for the USB-transfer
...@@ -189,26 +185,29 @@ static DECLARE_MUTEX(start_stop_sem); ...@@ -189,26 +185,29 @@ static DECLARE_MUTEX(start_stop_sem);
static int send_dux_commands(usbduxfastsub_t * this_usbduxfastsub, int cmd_type) static int send_dux_commands(usbduxfastsub_t * this_usbduxfastsub, int cmd_type)
{ {
int result, nsent; int tmp, nsent;
this_usbduxfastsub->dux_commands[0] = cmd_type; this_usbduxfastsub->dux_commands[0] = cmd_type;
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
int i; printk(KERN_DEBUG "comedi%d: usbduxfast: dux_commands: ",
printk("comedi%d: usbduxfast: dux_commands: ",
this_usbduxfastsub->comedidev->minor); this_usbduxfastsub->comedidev->minor);
for (i = 0; i < SIZEOFDUXBUFFER; i++) { for (tmp = 0; tmp < SIZEOFDUXBUFFER; tmp++)
printk(" %02x", this_usbduxfastsub->dux_commands[i]); printk(" %02x", this_usbduxfastsub->dux_commands[tmp]);
}
printk("\n"); printk("\n");
#endif #endif
result = usb_bulk_msg(this_usbduxfastsub->usbdev,
tmp = usb_bulk_msg(this_usbduxfastsub->usbdev,
usb_sndbulkpipe(this_usbduxfastsub->usbdev, usb_sndbulkpipe(this_usbduxfastsub->usbdev,
CHANNELLISTEP), CHANNELLISTEP),
this_usbduxfastsub->dux_commands, SIZEOFDUXBUFFER, this_usbduxfastsub->dux_commands, SIZEOFDUXBUFFER,
&nsent, 10000); &nsent, 10000);
if (result < 0) { if (tmp < 0)
printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result); printk(KERN_ERR "comedi%d: could not transmit dux_commands to"
} "the usb-device, err=%d\n",
return result; this_usbduxfastsub->comedidev->minor, tmp);
return tmp;
} }
// Stops the data acquision // Stops the data acquision
...@@ -548,10 +547,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub) ...@@ -548,10 +547,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub)
SIZEINBUF, usbduxfastsub_ai_Irq, usbduxfastsub->comedidev); SIZEINBUF, usbduxfastsub_ai_Irq, usbduxfastsub->comedidev);
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
printk("comedi%d: usbduxfast: submitting in-urb: %x,%x\n", printk("comedi%d: usbduxfast: submitting in-urb: 0x%p,0x%p\n",
usbduxfastsub->comedidev->minor, usbduxfastsub->comedidev->minor,
(int)(usbduxfastsub->urbIn->context), usbduxfastsub->urbIn->context,
(int)(usbduxfastsub->urbIn->dev)); usbduxfastsub->urbIn->dev);
#endif #endif
errFlag = usb_submit_urb(usbduxfastsub->urbIn, GFP_ATOMIC); errFlag = usb_submit_urb(usbduxfastsub->urbIn, GFP_ATOMIC);
if (errFlag) { if (errFlag) {
...@@ -826,9 +825,8 @@ static int usbduxfast_ai_cmd(comedi_device * dev, comedi_subdevice * s) ...@@ -826,9 +825,8 @@ static int usbduxfast_ai_cmd(comedi_device * dev, comedi_subdevice * s)
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
printk("comedi%d: usbduxfast: steps=%ld, convert_arg=%u, ai_timer=%u\n", printk("comedi%d: usbduxfast: steps=%ld, convert_arg=%u\n",
dev->minor, dev->minor, steps, cmd->convert_arg);
steps, cmd->convert_arg, this_usbduxfastsub->ai_timer);
#endif #endif
switch (cmd->chanlist_len) { switch (cmd->chanlist_len) {
...@@ -1211,10 +1209,10 @@ static int usbduxfast_ai_insn_read(comedi_device * dev, ...@@ -1211,10 +1209,10 @@ static int usbduxfast_ai_insn_read(comedi_device * dev,
return err; return err;
} }
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
printk("comedi%d: usbduxfast: submitting in-urb: %x,%x\n", printk("comedi%d: usbduxfast: submitting in-urb: 0x%p,0x%p\n",
usbduxfastsub->comedidev->minor, usbduxfastsub->comedidev->minor,
(int)(usbduxfastsub->urbIn->context), usbduxfastsub->urbIn->context,
(int)(usbduxfastsub->urbIn->dev)); usbduxfastsub->urbIn->dev);
#endif #endif
for (i = 0; i < PACKETS_TO_IGNORE; i++) { for (i = 0; i < PACKETS_TO_IGNORE; i++) {
err = usb_bulk_msg(usbduxfastsub->usbdev, err = usb_bulk_msg(usbduxfastsub->usbdev,
......
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