Commit 88676359 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4aa3a823
...@@ -58,7 +58,6 @@ Status: testing ...@@ -58,7 +58,6 @@ Status: testing
#include <linux/compiler.h> #include <linux/compiler.h>
#include "comedi_fc.h" #include "comedi_fc.h"
#include "../comedidev.h" #include "../comedidev.h"
#include "../usb.h"
// (un)comment this if you want to have debug info. // (un)comment this if you want to have debug info.
//#define CONFIG_COMEDI_DEBUG //#define CONFIG_COMEDI_DEBUG
...@@ -203,11 +202,11 @@ static int send_dux_commands(usbduxfastsub_t * this_usbduxfastsub, int cmd_type) ...@@ -203,11 +202,11 @@ static int send_dux_commands(usbduxfastsub_t * this_usbduxfastsub, int cmd_type)
} }
printk("\n"); printk("\n");
#endif #endif
result = USB_BULK_MSG(this_usbduxfastsub->usbdev, result = usb_bulk_msg(this_usbduxfastsub->usbdev,
usb_sndbulkpipe(this_usbduxfastsub->usbdev, usb_sndbulkpipe(this_usbduxfastsub->usbdev,
CHANNELLISTEP), CHANNELLISTEP),
this_usbduxfastsub->dux_commands, this_usbduxfastsub->dux_commands, SIZEOFDUXBUFFER,
SIZEOFDUXBUFFER, &nsent, 10000); &nsent, 10000);
if (result < 0) { if (result < 0) {
printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result); printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result);
} }
...@@ -404,7 +403,8 @@ static void usbduxfastsub_ai_Irq(struct urb *urb PT_REGS_ARG) ...@@ -404,7 +403,8 @@ static void usbduxfastsub_ai_Irq(struct urb *urb PT_REGS_ARG)
// resubmit urb for BULK transfer // resubmit urb for BULK transfer
urb->dev = this_usbduxfastsub->usbdev; urb->dev = this_usbduxfastsub->usbdev;
urb->status = 0; urb->status = 0;
if ((err = USB_SUBMIT_URB(urb)) < 0) { err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) {
printk("comedi%d: usbduxfast: urb resubm failed: %d", printk("comedi%d: usbduxfast: urb resubm failed: %d",
this_usbduxfastsub->comedidev->minor, err); this_usbduxfastsub->comedidev->minor, err);
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
...@@ -422,7 +422,7 @@ static int usbduxfastsub_start(usbduxfastsub_t * usbduxfastsub) ...@@ -422,7 +422,7 @@ static int usbduxfastsub_start(usbduxfastsub_t * usbduxfastsub)
if (usbduxfastsub->probed) { if (usbduxfastsub->probed) {
// 7f92 to zero // 7f92 to zero
local_transfer_buffer[0] = 0; local_transfer_buffer[0] = 0;
errcode = USB_CONTROL_MSG(usbduxfastsub->usbdev, errcode = usb_control_msg(usbduxfastsub->usbdev,
// create a pipe for a control transfer // create a pipe for a control transfer
usb_sndctrlpipe(usbduxfastsub->usbdev, 0), usb_sndctrlpipe(usbduxfastsub->usbdev, 0),
// bRequest, "Firmware" // bRequest, "Firmware"
...@@ -455,8 +455,7 @@ static int usbduxfastsub_stop(usbduxfastsub_t * usbduxfastsub) ...@@ -455,8 +455,7 @@ static int usbduxfastsub_stop(usbduxfastsub_t * usbduxfastsub)
if (usbduxfastsub->probed) { if (usbduxfastsub->probed) {
// 7f92 to one // 7f92 to one
local_transfer_buffer[0] = 1; local_transfer_buffer[0] = 1;
errcode = USB_CONTROL_MSG errcode = usb_control_msg(usbduxfastsub->usbdev,
(usbduxfastsub->usbdev,
usb_sndctrlpipe(usbduxfastsub->usbdev, 0), usb_sndctrlpipe(usbduxfastsub->usbdev, 0),
// bRequest, "Firmware" // bRequest, "Firmware"
USBDUXFASTSUB_FIRMWARE, USBDUXFASTSUB_FIRMWARE,
...@@ -491,8 +490,7 @@ static int usbduxfastsub_upload(usbduxfastsub_t * usbduxfastsub, ...@@ -491,8 +490,7 @@ static int usbduxfastsub_upload(usbduxfastsub_t * usbduxfastsub,
printk(" to addr %d, first byte=%d.\n", printk(" to addr %d, first byte=%d.\n",
startAddr, local_transfer_buffer[0]); startAddr, local_transfer_buffer[0]);
#endif #endif
errcode = USB_CONTROL_MSG errcode = usb_control_msg(usbduxfastsub->usbdev,
(usbduxfastsub->usbdev,
usb_sndctrlpipe(usbduxfastsub->usbdev, 0), usb_sndctrlpipe(usbduxfastsub->usbdev, 0),
// brequest, firmware // brequest, firmware
USBDUXFASTSUB_FIRMWARE, USBDUXFASTSUB_FIRMWARE,
...@@ -568,11 +566,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub) ...@@ -568,11 +566,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub)
(int)(usbduxfastsub->urbIn->context), (int)(usbduxfastsub->urbIn->context),
(int)(usbduxfastsub->urbIn->dev)); (int)(usbduxfastsub->urbIn->dev));
#endif #endif
errFlag = USB_SUBMIT_URB(usbduxfastsub->urbIn); errFlag = usb_submit_urb(usbduxfastsub->urbIn, GFP_ATOMIC);
if (errFlag) { if (errFlag) {
printk("comedi_: usbduxfast: ai: "); printk("comedi_: usbduxfast: ai: usb_submit_urb error %d\n",
printk("USB_SUBMIT_URB"); errFlag);
printk(" error %d\n", errFlag);
return errFlag; return errFlag;
} }
return 0; return 0;
...@@ -1233,10 +1230,11 @@ static int usbduxfast_ai_insn_read(comedi_device * dev, ...@@ -1233,10 +1230,11 @@ static int usbduxfast_ai_insn_read(comedi_device * dev,
(int)(usbduxfastsub->urbIn->dev)); (int)(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,
usb_rcvbulkpipe(usbduxfastsub->usbdev, BULKINEP), usb_rcvbulkpipe(usbduxfastsub->usbdev,
usbduxfastsub->transfer_buffer, BULKINEP),
SIZEINBUF, &actual_length, 10000); usbduxfastsub->transfer_buffer, SIZEINBUF,
&actual_length, 10000);
if (err < 0) { if (err < 0) {
printk("comedi%d: insn timeout. No data.\n", printk("comedi%d: insn timeout. No data.\n",
dev->minor); dev->minor);
...@@ -1246,10 +1244,11 @@ static int usbduxfast_ai_insn_read(comedi_device * dev, ...@@ -1246,10 +1244,11 @@ static int usbduxfast_ai_insn_read(comedi_device * dev,
} }
// data points // data points
for (i = 0; i < insn->n;) { for (i = 0; i < insn->n;) {
err = USB_BULK_MSG(usbduxfastsub->usbdev, err = usb_bulk_msg(usbduxfastsub->usbdev,
usb_rcvbulkpipe(usbduxfastsub->usbdev, BULKINEP), usb_rcvbulkpipe(usbduxfastsub->usbdev,
usbduxfastsub->transfer_buffer, BULKINEP),
SIZEINBUF, &actual_length, 10000); usbduxfastsub->transfer_buffer, SIZEINBUF,
&actual_length, 10000);
if (err < 0) { if (err < 0) {
printk("comedi%d: insn data error: %d\n", printk("comedi%d: insn data error: %d\n",
dev->minor, err); dev->minor, err);
...@@ -1448,7 +1447,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, ...@@ -1448,7 +1447,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
if (udev->speed != USB_SPEED_HIGH) { if (udev->speed != USB_SPEED_HIGH) {
printk("comedi_: usbduxfast_: This driver needs USB 2.0 to operate. Aborting...\n"); printk("comedi_: usbduxfast_: This driver needs USB 2.0 to operate. Aborting...\n");
return PROBE_ERR_RETURN(-ENODEV); return -ENODEV;
} }
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
printk("comedi_: usbduxfast_: finding a free structure for the usb-device\n"); 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,7 +1466,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
if (index == -1) { if (index == -1) {
printk("Too many usbduxfast-devices connected.\n"); printk("Too many usbduxfast-devices connected.\n");
up(&start_stop_sem); up(&start_stop_sem);
return PROBE_ERR_RETURN(-EMFILE); return -EMFILE;
} }
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
printk("comedi_: usbduxfast: usbduxfastsub[%d] is ready to connect to comedi.\n", index); 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,7 +1499,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
printk("comedi_: usbduxfast: error alloc space for dac commands\n"); printk("comedi_: usbduxfast: error alloc space for dac commands\n");
tidy_up(&(usbduxfastsub[index])); tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem); up(&start_stop_sem);
return PROBE_ERR_RETURN(-ENOMEM); return -ENOMEM;
} }
// create space of the instruction buffer // create space of the instruction buffer
usbduxfastsub[index].insnBuffer = kmalloc(SIZEINSNBUF, GFP_KERNEL); usbduxfastsub[index].insnBuffer = kmalloc(SIZEINSNBUF, GFP_KERNEL);
...@@ -1508,7 +1507,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, ...@@ -1508,7 +1507,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
printk("comedi_: usbduxfast: could not alloc space for insnBuffer\n"); printk("comedi_: usbduxfast: could not alloc space for insnBuffer\n");
tidy_up(&(usbduxfastsub[index])); tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem); up(&start_stop_sem);
return PROBE_ERR_RETURN(-ENOMEM); return -ENOMEM;
} }
// setting to alternate setting 1: enabling bulk ep // setting to alternate setting 1: enabling bulk ep
i = usb_set_interface(usbduxfastsub[index].usbdev, i = usb_set_interface(usbduxfastsub[index].usbdev,
...@@ -1517,14 +1516,14 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, ...@@ -1517,14 +1516,14 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
printk("comedi_: usbduxfast%d: could not switch to alternate setting 1.\n", index); printk("comedi_: usbduxfast%d: could not switch to alternate setting 1.\n", index);
tidy_up(&(usbduxfastsub[index])); tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem); up(&start_stop_sem);
return PROBE_ERR_RETURN(-ENODEV); return -ENODEV;
} }
usbduxfastsub[index].urbIn = USB_ALLOC_URB(0); usbduxfastsub[index].urbIn = usb_alloc_urb(0, GFP_KERNEL);
if (usbduxfastsub[index].urbIn == NULL) { if (usbduxfastsub[index].urbIn == NULL) {
printk("comedi_: usbduxfast%d: Could not alloc. urb\n", index); printk("comedi_: usbduxfast%d: Could not alloc. urb\n", index);
tidy_up(&(usbduxfastsub[index])); tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem); up(&start_stop_sem);
return PROBE_ERR_RETURN(-ENOMEM); return -ENOMEM;
} }
usbduxfastsub[index].transfer_buffer = kmalloc(SIZEINBUF, GFP_KERNEL); usbduxfastsub[index].transfer_buffer = kmalloc(SIZEINBUF, GFP_KERNEL);
if (!(usbduxfastsub[index].transfer_buffer)) { if (!(usbduxfastsub[index].transfer_buffer)) {
...@@ -1532,7 +1531,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf, ...@@ -1532,7 +1531,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
index); index);
tidy_up(&(usbduxfastsub[index])); tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem); up(&start_stop_sem);
return PROBE_ERR_RETURN(-ENOMEM); return -ENOMEM;
} }
// we've reached the bottom of the function // we've reached the bottom of the function
usbduxfastsub[index].probed = 1; usbduxfastsub[index].probed = 1;
......
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