diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-11-18 20:09:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 16:52:22 -0500 |
commit | 8867635903ea4c52776820954ae7aaaca1e438cb (patch) | |
tree | 693ca08665b227a44080548adde3a2d6d4046f60 /drivers | |
parent | 4aa3a8232158abeea939ec12770fdfcf2987b3c4 (diff) |
Staging: comedi: usbduxfast: remove comedi usb wrappers
Remove the comedi usb wrapper function usage in the usbduxfast driver as
they are no longer needed.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxfast.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index 403a614000b1..3a00ff0cfc5a 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c | |||
@@ -58,7 +58,6 @@ Status: testing | |||
58 | #include <linux/compiler.h> | 58 | #include <linux/compiler.h> |
59 | #include "comedi_fc.h" | 59 | #include "comedi_fc.h" |
60 | #include "../comedidev.h" | 60 | #include "../comedidev.h" |
61 | #include "../usb.h" | ||
62 | 61 | ||
63 | // (un)comment this if you want to have debug info. | 62 | // (un)comment this if you want to have debug info. |
64 | //#define CONFIG_COMEDI_DEBUG | 63 | //#define CONFIG_COMEDI_DEBUG |
@@ -203,11 +202,11 @@ static int send_dux_commands(usbduxfastsub_t * this_usbduxfastsub, int cmd_type) | |||
203 | } | 202 | } |
204 | printk("\n"); | 203 | printk("\n"); |
205 | #endif | 204 | #endif |
206 | result = USB_BULK_MSG(this_usbduxfastsub->usbdev, | 205 | result = usb_bulk_msg(this_usbduxfastsub->usbdev, |
207 | usb_sndbulkpipe(this_usbduxfastsub->usbdev, | 206 | usb_sndbulkpipe(this_usbduxfastsub->usbdev, |
208 | CHANNELLISTEP), | 207 | CHANNELLISTEP), |
209 | this_usbduxfastsub->dux_commands, | 208 | this_usbduxfastsub->dux_commands, SIZEOFDUXBUFFER, |
210 | SIZEOFDUXBUFFER, &nsent, 10000); | 209 | &nsent, 10000); |
211 | if (result < 0) { | 210 | if (result < 0) { |
212 | printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result); | 211 | printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result); |
213 | } | 212 | } |
@@ -404,7 +403,8 @@ static void usbduxfastsub_ai_Irq(struct urb *urb PT_REGS_ARG) | |||
404 | // resubmit urb for BULK transfer | 403 | // resubmit urb for BULK transfer |
405 | urb->dev = this_usbduxfastsub->usbdev; | 404 | urb->dev = this_usbduxfastsub->usbdev; |
406 | urb->status = 0; | 405 | urb->status = 0; |
407 | if ((err = USB_SUBMIT_URB(urb)) < 0) { | 406 | err = usb_submit_urb(urb, GFP_ATOMIC); |
407 | if (err < 0) { | ||
408 | printk("comedi%d: usbduxfast: urb resubm failed: %d", | 408 | printk("comedi%d: usbduxfast: urb resubm failed: %d", |
409 | this_usbduxfastsub->comedidev->minor, err); | 409 | this_usbduxfastsub->comedidev->minor, err); |
410 | s->async->events |= COMEDI_CB_EOA; | 410 | s->async->events |= COMEDI_CB_EOA; |
@@ -422,7 +422,7 @@ static int usbduxfastsub_start(usbduxfastsub_t * usbduxfastsub) | |||
422 | if (usbduxfastsub->probed) { | 422 | if (usbduxfastsub->probed) { |
423 | // 7f92 to zero | 423 | // 7f92 to zero |
424 | local_transfer_buffer[0] = 0; | 424 | local_transfer_buffer[0] = 0; |
425 | errcode = USB_CONTROL_MSG(usbduxfastsub->usbdev, | 425 | errcode = usb_control_msg(usbduxfastsub->usbdev, |
426 | // create a pipe for a control transfer | 426 | // create a pipe for a control transfer |
427 | usb_sndctrlpipe(usbduxfastsub->usbdev, 0), | 427 | usb_sndctrlpipe(usbduxfastsub->usbdev, 0), |
428 | // bRequest, "Firmware" | 428 | // bRequest, "Firmware" |
@@ -455,8 +455,7 @@ static int usbduxfastsub_stop(usbduxfastsub_t * usbduxfastsub) | |||
455 | if (usbduxfastsub->probed) { | 455 | if (usbduxfastsub->probed) { |
456 | // 7f92 to one | 456 | // 7f92 to one |
457 | local_transfer_buffer[0] = 1; | 457 | local_transfer_buffer[0] = 1; |
458 | errcode = USB_CONTROL_MSG | 458 | errcode = usb_control_msg(usbduxfastsub->usbdev, |
459 | (usbduxfastsub->usbdev, | ||
460 | usb_sndctrlpipe(usbduxfastsub->usbdev, 0), | 459 | usb_sndctrlpipe(usbduxfastsub->usbdev, 0), |
461 | // bRequest, "Firmware" | 460 | // bRequest, "Firmware" |
462 | USBDUXFASTSUB_FIRMWARE, | 461 | USBDUXFASTSUB_FIRMWARE, |
@@ -491,8 +490,7 @@ static int usbduxfastsub_upload(usbduxfastsub_t * usbduxfastsub, | |||
491 | printk(" to addr %d, first byte=%d.\n", | 490 | printk(" to addr %d, first byte=%d.\n", |
492 | startAddr, local_transfer_buffer[0]); | 491 | startAddr, local_transfer_buffer[0]); |
493 | #endif | 492 | #endif |
494 | errcode = USB_CONTROL_MSG | 493 | errcode = usb_control_msg(usbduxfastsub->usbdev, |
495 | (usbduxfastsub->usbdev, | ||
496 | usb_sndctrlpipe(usbduxfastsub->usbdev, 0), | 494 | usb_sndctrlpipe(usbduxfastsub->usbdev, 0), |
497 | // brequest, firmware | 495 | // brequest, firmware |
498 | USBDUXFASTSUB_FIRMWARE, | 496 | USBDUXFASTSUB_FIRMWARE, |
@@ -568,11 +566,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub) | |||
568 | (int)(usbduxfastsub->urbIn->context), | 566 | (int)(usbduxfastsub->urbIn->context), |
569 | (int)(usbduxfastsub->urbIn->dev)); | 567 | (int)(usbduxfastsub->urbIn->dev)); |
570 | #endif | 568 | #endif |
571 | errFlag = USB_SUBMIT_URB(usbduxfastsub->urbIn); | 569 | errFlag = usb_submit_urb(usbduxfastsub->urbIn, GFP_ATOMIC); |
572 | if (errFlag) { | 570 | if (errFlag) { |
573 | printk("comedi_: usbduxfast: ai: "); | 571 | printk("comedi_: usbduxfast: ai: usb_submit_urb error %d\n", |
574 | printk("USB_SUBMIT_URB"); | 572 | errFlag); |
575 | printk(" error %d\n", errFlag); | ||
576 | return errFlag; | 573 | return errFlag; |
577 | } | 574 | } |
578 | return 0; | 575 | return 0; |
@@ -1233,10 +1230,11 @@ static int usbduxfast_ai_insn_read(comedi_device * dev, | |||
1233 | (int)(usbduxfastsub->urbIn->dev)); | 1230 | (int)(usbduxfastsub->urbIn->dev)); |
1234 | #endif | 1231 | #endif |
1235 | for (i = 0; i < PACKETS_TO_IGNORE; i++) { | 1232 | for (i = 0; i < PACKETS_TO_IGNORE; i++) { |
1236 | err = USB_BULK_MSG(usbduxfastsub->usbdev, | 1233 | err = usb_bulk_msg(usbduxfastsub->usbdev, |
1237 | usb_rcvbulkpipe(usbduxfastsub->usbdev, BULKINEP), | 1234 | usb_rcvbulkpipe(usbduxfastsub->usbdev, |
1238 | usbduxfastsub->transfer_buffer, | 1235 | BULKINEP), |
1239 | SIZEINBUF, &actual_length, 10000); | 1236 | usbduxfastsub->transfer_buffer, SIZEINBUF, |
1237 | &actual_length, 10000); | ||
1240 | if (err < 0) { | 1238 | if (err < 0) { |
1241 | printk("comedi%d: insn timeout. No data.\n", | 1239 | printk("comedi%d: insn timeout. No data.\n", |
1242 | dev->minor); | 1240 | dev->minor); |
@@ -1246,10 +1244,11 @@ static int usbduxfast_ai_insn_read(comedi_device * dev, | |||
1246 | } | 1244 | } |
1247 | // data points | 1245 | // data points |
1248 | for (i = 0; i < insn->n;) { | 1246 | for (i = 0; i < insn->n;) { |
1249 | err = USB_BULK_MSG(usbduxfastsub->usbdev, | 1247 | err = usb_bulk_msg(usbduxfastsub->usbdev, |
1250 | usb_rcvbulkpipe(usbduxfastsub->usbdev, BULKINEP), | 1248 | usb_rcvbulkpipe(usbduxfastsub->usbdev, |
1251 | usbduxfastsub->transfer_buffer, | 1249 | BULKINEP), |
1252 | SIZEINBUF, &actual_length, 10000); | 1250 | usbduxfastsub->transfer_buffer, SIZEINBUF, |
1251 | &actual_length, 10000); | ||
1253 | if (err < 0) { | 1252 | if (err < 0) { |
1254 | printk("comedi%d: insn data error: %d\n", | 1253 | printk("comedi%d: insn data error: %d\n", |
1255 | dev->minor, err); | 1254 | dev->minor, err); |
@@ -1448,7 +1447,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, | |||
1448 | 1447 | ||
1449 | if (udev->speed != USB_SPEED_HIGH) { | 1448 | if (udev->speed != USB_SPEED_HIGH) { |
1450 | printk("comedi_: usbduxfast_: This driver needs USB 2.0 to operate. Aborting...\n"); | 1449 | printk("comedi_: usbduxfast_: This driver needs USB 2.0 to operate. Aborting...\n"); |
1451 | return PROBE_ERR_RETURN(-ENODEV); | 1450 | return -ENODEV; |
1452 | } | 1451 | } |
1453 | #ifdef CONFIG_COMEDI_DEBUG | 1452 | #ifdef CONFIG_COMEDI_DEBUG |
1454 | printk("comedi_: usbduxfast_: finding a free structure for the usb-device\n"); | 1453 | printk("comedi_: usbduxfast_: finding a free structure for the usb-device\n"); |
@@ -1467,7 +1466,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, | |||
1467 | if (index == -1) { | 1466 | if (index == -1) { |
1468 | printk("Too many usbduxfast-devices connected.\n"); | 1467 | printk("Too many usbduxfast-devices connected.\n"); |
1469 | up(&start_stop_sem); | 1468 | up(&start_stop_sem); |
1470 | return PROBE_ERR_RETURN(-EMFILE); | 1469 | return -EMFILE; |
1471 | } | 1470 | } |
1472 | #ifdef CONFIG_COMEDI_DEBUG | 1471 | #ifdef CONFIG_COMEDI_DEBUG |
1473 | printk("comedi_: usbduxfast: usbduxfastsub[%d] is ready to connect to comedi.\n", index); | 1472 | printk("comedi_: usbduxfast: usbduxfastsub[%d] is ready to connect to comedi.\n", index); |
@@ -1500,7 +1499,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, | |||
1500 | printk("comedi_: usbduxfast: error alloc space for dac commands\n"); | 1499 | printk("comedi_: usbduxfast: error alloc space for dac commands\n"); |
1501 | tidy_up(&(usbduxfastsub[index])); | 1500 | tidy_up(&(usbduxfastsub[index])); |
1502 | up(&start_stop_sem); | 1501 | up(&start_stop_sem); |
1503 | return PROBE_ERR_RETURN(-ENOMEM); | 1502 | return -ENOMEM; |
1504 | } | 1503 | } |
1505 | // create space of the instruction buffer | 1504 | // create space of the instruction buffer |
1506 | usbduxfastsub[index].insnBuffer = kmalloc(SIZEINSNBUF, GFP_KERNEL); | 1505 | usbduxfastsub[index].insnBuffer = kmalloc(SIZEINSNBUF, GFP_KERNEL); |
@@ -1508,7 +1507,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, | |||
1508 | printk("comedi_: usbduxfast: could not alloc space for insnBuffer\n"); | 1507 | printk("comedi_: usbduxfast: could not alloc space for insnBuffer\n"); |
1509 | tidy_up(&(usbduxfastsub[index])); | 1508 | tidy_up(&(usbduxfastsub[index])); |
1510 | up(&start_stop_sem); | 1509 | up(&start_stop_sem); |
1511 | return PROBE_ERR_RETURN(-ENOMEM); | 1510 | return -ENOMEM; |
1512 | } | 1511 | } |
1513 | // setting to alternate setting 1: enabling bulk ep | 1512 | // setting to alternate setting 1: enabling bulk ep |
1514 | i = usb_set_interface(usbduxfastsub[index].usbdev, | 1513 | i = usb_set_interface(usbduxfastsub[index].usbdev, |
@@ -1517,14 +1516,14 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, | |||
1517 | printk("comedi_: usbduxfast%d: could not switch to alternate setting 1.\n", index); | 1516 | printk("comedi_: usbduxfast%d: could not switch to alternate setting 1.\n", index); |
1518 | tidy_up(&(usbduxfastsub[index])); | 1517 | tidy_up(&(usbduxfastsub[index])); |
1519 | up(&start_stop_sem); | 1518 | up(&start_stop_sem); |
1520 | return PROBE_ERR_RETURN(-ENODEV); | 1519 | return -ENODEV; |
1521 | } | 1520 | } |
1522 | usbduxfastsub[index].urbIn = USB_ALLOC_URB(0); | 1521 | usbduxfastsub[index].urbIn = usb_alloc_urb(0, GFP_KERNEL); |
1523 | if (usbduxfastsub[index].urbIn == NULL) { | 1522 | if (usbduxfastsub[index].urbIn == NULL) { |
1524 | printk("comedi_: usbduxfast%d: Could not alloc. urb\n", index); | 1523 | printk("comedi_: usbduxfast%d: Could not alloc. urb\n", index); |
1525 | tidy_up(&(usbduxfastsub[index])); | 1524 | tidy_up(&(usbduxfastsub[index])); |
1526 | up(&start_stop_sem); | 1525 | up(&start_stop_sem); |
1527 | return PROBE_ERR_RETURN(-ENOMEM); | 1526 | return -ENOMEM; |
1528 | } | 1527 | } |
1529 | usbduxfastsub[index].transfer_buffer = kmalloc(SIZEINBUF, GFP_KERNEL); | 1528 | usbduxfastsub[index].transfer_buffer = kmalloc(SIZEINBUF, GFP_KERNEL); |
1530 | if (!(usbduxfastsub[index].transfer_buffer)) { | 1529 | if (!(usbduxfastsub[index].transfer_buffer)) { |
@@ -1532,7 +1531,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, | |||
1532 | index); | 1531 | index); |
1533 | tidy_up(&(usbduxfastsub[index])); | 1532 | tidy_up(&(usbduxfastsub[index])); |
1534 | up(&start_stop_sem); | 1533 | up(&start_stop_sem); |
1535 | return PROBE_ERR_RETURN(-ENOMEM); | 1534 | return -ENOMEM; |
1536 | } | 1535 | } |
1537 | // we've reached the bottom of the function | 1536 | // we've reached the bottom of the function |
1538 | usbduxfastsub[index].probed = 1; | 1537 | usbduxfastsub[index].probed = 1; |