Commit d8b6ca08 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: pass usb interface to comedi_usb_auto_config

The comedi_usb_auto_config() and comedi_usb_auto_unconfig() functions
currently take a 'struct usb_device *'.  It makes more sense to pass a
'struct usb_interface *' to allow for composite USB devices.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c43435d7
......@@ -460,10 +460,10 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s);
int comedi_pci_auto_config(struct pci_dev *pcidev,
struct comedi_driver *driver);
void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
struct usb_device; /* forward declaration */
int comedi_usb_auto_config(struct usb_device *usbdev,
struct usb_interface; /* forward declaration */
int comedi_usb_auto_config(struct usb_interface *intf,
struct comedi_driver *driver);
void comedi_usb_auto_unconfig(struct usb_device *usbdev);
void comedi_usb_auto_unconfig(struct usb_interface *intf);
#ifdef CONFIG_COMEDI_PCI_DRIVERS
#define CONFIG_COMEDI_PCI
......
......@@ -880,17 +880,17 @@ void comedi_pci_auto_unconfig(struct pci_dev *pcidev)
}
EXPORT_SYMBOL_GPL(comedi_pci_auto_unconfig);
int comedi_usb_auto_config(struct usb_device *usbdev,
int comedi_usb_auto_config(struct usb_interface *intf,
struct comedi_driver *driver)
{
BUG_ON(usbdev == NULL);
return comedi_auto_config(&usbdev->dev, driver->driver_name, NULL, 0);
BUG_ON(intf == NULL);
return comedi_auto_config(&intf->dev, driver->driver_name, NULL, 0);
}
EXPORT_SYMBOL_GPL(comedi_usb_auto_config);
void comedi_usb_auto_unconfig(struct usb_device *usbdev)
void comedi_usb_auto_unconfig(struct usb_interface *intf)
{
BUG_ON(usbdev == NULL);
comedi_auto_unconfig(&usbdev->dev);
BUG_ON(intf == NULL);
comedi_auto_unconfig(&intf->dev);
}
EXPORT_SYMBOL_GPL(comedi_usb_auto_unconfig);
......@@ -2306,11 +2306,11 @@ static void usbdux_firmware_request_complete_handler(const struct firmware *fw,
void *context)
{
struct usbduxsub *usbduxsub_tmp = context;
struct usb_device *usbdev = usbduxsub_tmp->usbdev;
struct usb_interface *uinterf = usbduxsub_tmp->interface;
int ret;
if (fw == NULL) {
dev_err(&usbdev->dev,
dev_err(&uinterf->dev,
"Firmware complete handler without firmware!\n");
return;
}
......@@ -2322,11 +2322,11 @@ static void usbdux_firmware_request_complete_handler(const struct firmware *fw,
ret = firmwareUpload(usbduxsub_tmp, fw->data, fw->size);
if (ret) {
dev_err(&usbdev->dev,
dev_err(&uinterf->dev,
"Could not upload firmware (err=%d)\n", ret);
goto out;
}
comedi_usb_auto_config(usbdev, &driver_usbdux);
comedi_usb_auto_config(uinterf, &driver_usbdux);
out:
release_firmware(fw);
}
......@@ -2608,7 +2608,7 @@ static void usbduxsub_disconnect(struct usb_interface *intf)
dev_err(&intf->dev, "comedi_: BUG! called with wrong ptr!!!\n");
return;
}
comedi_usb_auto_unconfig(udev);
comedi_usb_auto_unconfig(intf);
down(&start_stop_sem);
down(&usbduxsub_tmp->sem);
tidy_up(usbduxsub_tmp);
......
......@@ -1442,7 +1442,7 @@ static void usbduxfast_firmware_request_complete_handler(const struct firmware
*fw, void *context)
{
struct usbduxfastsub_s *usbduxfastsub_tmp = context;
struct usb_device *usbdev = usbduxfastsub_tmp->usbdev;
struct usb_interface *uinterf = usbduxfastsub_tmp->interface;
int ret;
if (fw == NULL)
......@@ -1455,12 +1455,12 @@ static void usbduxfast_firmware_request_complete_handler(const struct firmware
ret = firmwareUpload(usbduxfastsub_tmp, fw->data, fw->size);
if (ret) {
dev_err(&usbdev->dev,
dev_err(&uinterf->dev,
"Could not upload firmware (err=%d)\n", ret);
goto out;
}
comedi_usb_auto_config(usbdev, &driver_usbduxfast);
comedi_usb_auto_config(uinterf, &driver_usbduxfast);
out:
release_firmware(fw);
}
......@@ -1608,7 +1608,7 @@ static void usbduxfastsub_disconnect(struct usb_interface *intf)
return;
}
comedi_usb_auto_unconfig(udev);
comedi_usb_auto_unconfig(intf);
down(&start_stop_sem);
down(&udfs->sem);
......
......@@ -2314,11 +2314,11 @@ static void usbdux_firmware_request_complete_handler(const struct firmware *fw,
void *context)
{
struct usbduxsub *usbduxsub_tmp = context;
struct usb_device *usbdev = usbduxsub_tmp->usbdev;
struct usb_interface *uinterf = usbduxsub_tmp->interface;
int ret;
if (fw == NULL) {
dev_err(&usbdev->dev,
dev_err(&uinterf->dev,
"Firmware complete handler without firmware!\n");
return;
}
......@@ -2330,11 +2330,11 @@ static void usbdux_firmware_request_complete_handler(const struct firmware *fw,
ret = firmwareUpload(usbduxsub_tmp, fw->data, fw->size);
if (ret) {
dev_err(&usbdev->dev,
dev_err(&uinterf->dev,
"Could not upload firmware (err=%d)\n", ret);
goto out;
}
comedi_usb_auto_config(usbdev, &driver_usbduxsigma);
comedi_usb_auto_config(uinterf, &driver_usbduxsigma);
out:
release_firmware(fw);
}
......@@ -2625,7 +2625,7 @@ static void usbduxsigma_disconnect(struct usb_interface *intf)
if (usbduxsub_tmp->ao_cmd_running)
/* we are still running a command */
usbdux_ao_stop(usbduxsub_tmp, 1);
comedi_usb_auto_unconfig(udev);
comedi_usb_auto_unconfig(intf);
down(&start_stop_sem);
down(&usbduxsub_tmp->sem);
tidy_up(usbduxsub_tmp);
......
......@@ -1484,7 +1484,7 @@ static int vmk80xx_probe(struct usb_interface *intf,
mutex_unlock(&glb_mutex);
comedi_usb_auto_config(dev->udev, &driver_vmk80xx);
comedi_usb_auto_config(intf, &driver_vmk80xx);
return 0;
error:
......@@ -1502,7 +1502,7 @@ static void vmk80xx_disconnect(struct usb_interface *intf)
if (!dev)
return;
comedi_usb_auto_unconfig(dev->udev);
comedi_usb_auto_unconfig(intf);
mutex_lock(&glb_mutex);
down(&dev->limit_sem);
......
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