diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2009-02-16 21:31:27 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 14:53:46 -0700 |
commit | 0a3b8b642247b509d3308cd9c32156d21505fcb8 (patch) | |
tree | f60f9ebc7ad713efe9a00310decb2d590d8ad160 | |
parent | 6fffdb355c326b26482307d421b55fc00ee2abbc (diff) |
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: Mariusz 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: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/comedi/Kconfig | 7 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxfast.c | 46 |
2 files changed, 29 insertions, 24 deletions
diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig index b47ca1e7e38..ab9439fa198 100644 --- a/drivers/staging/comedi/Kconfig +++ b/drivers/staging/comedi/Kconfig @@ -6,6 +6,13 @@ config COMEDI Enable support a wide range of data acquision devices 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 tristate "Comedi Real-time support" depends on COMEDI && RT diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index 8e5efaad76a..3439a0591e9 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c @@ -59,10 +59,6 @@ Status: testing #include "comedi_fc.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" // timeout for the USB-transfer @@ -189,26 +185,29 @@ static DECLARE_MUTEX(start_stop_sem); 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; + #ifdef CONFIG_COMEDI_DEBUG - int i; - printk("comedi%d: usbduxfast: dux_commands: ", + printk(KERN_DEBUG "comedi%d: usbduxfast: dux_commands: ", this_usbduxfastsub->comedidev->minor); - for (i = 0; i < SIZEOFDUXBUFFER; i++) { - printk(" %02x", this_usbduxfastsub->dux_commands[i]); - } + for (tmp = 0; tmp < SIZEOFDUXBUFFER; tmp++) + printk(" %02x", this_usbduxfastsub->dux_commands[tmp]); printk("\n"); #endif - result = usb_bulk_msg(this_usbduxfastsub->usbdev, + + tmp = usb_bulk_msg(this_usbduxfastsub->usbdev, usb_sndbulkpipe(this_usbduxfastsub->usbdev, CHANNELLISTEP), this_usbduxfastsub->dux_commands, SIZEOFDUXBUFFER, &nsent, 10000); - if (result < 0) { - printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result); - } - return result; + if (tmp < 0) + printk(KERN_ERR "comedi%d: could not transmit dux_commands to" + "the usb-device, err=%d\n", + this_usbduxfastsub->comedidev->minor, tmp); + + return tmp; } // Stops the data acquision @@ -548,10 +547,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub) SIZEINBUF, usbduxfastsub_ai_Irq, usbduxfastsub->comedidev); #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, - (int)(usbduxfastsub->urbIn->context), - (int)(usbduxfastsub->urbIn->dev)); + usbduxfastsub->urbIn->context, + usbduxfastsub->urbIn->dev); #endif errFlag = usb_submit_urb(usbduxfastsub->urbIn, GFP_ATOMIC); if (errFlag) { @@ -826,9 +825,8 @@ static int usbduxfast_ai_cmd(comedi_device * dev, comedi_subdevice * s) return -EINVAL; } #ifdef CONFIG_COMEDI_DEBUG - printk("comedi%d: usbduxfast: steps=%ld, convert_arg=%u, ai_timer=%u\n", - dev->minor, - steps, cmd->convert_arg, this_usbduxfastsub->ai_timer); + printk("comedi%d: usbduxfast: steps=%ld, convert_arg=%u\n", + dev->minor, steps, cmd->convert_arg); #endif switch (cmd->chanlist_len) { @@ -1211,10 +1209,10 @@ static int usbduxfast_ai_insn_read(comedi_device * dev, return err; } #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, - (int)(usbduxfastsub->urbIn->context), - (int)(usbduxfastsub->urbIn->dev)); + usbduxfastsub->urbIn->context, + usbduxfastsub->urbIn->dev); #endif for (i = 0; i < PACKETS_TO_IGNORE; i++) { err = usb_bulk_msg(usbduxfastsub->usbdev, |