Skip to content

Commit

Permalink
comedi vmk80xx: support comedi auto-configuration
Browse files Browse the repository at this point in the history
Add support for automatically associating a vmk8055 device with a
comedi device (previously the user had to use comedi_num_legacy_minors
to reserve device slots and then associate them with vmk8055 devices
using comedi_config).
Tested on multiple K8055s, but not on K8061s.

Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
J. Ali Harlow authored and Greg Kroah-Hartman committed May 18, 2011
1 parent c647ed5 commit 8ba69ce
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions drivers/staging/comedi/drivers/vmk80xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ Status: works

#include "../comedidev.h"

#define BOARDNAME "vmk80xx"

MODULE_AUTHOR("Manuel Gebele <forensixs@gmx.de>");
MODULE_DESCRIPTION("Velleman USB Board Low-Level Driver");
MODULE_SUPPORTED_DEVICE("K8055/K8061 aka VM110/VM140");
Expand Down Expand Up @@ -1480,6 +1482,8 @@ static int vmk80xx_probe(struct usb_interface *intf,

mutex_unlock(&glb_mutex);

comedi_usb_auto_config(dev->udev, BOARDNAME);

return 0;
error:
mutex_unlock(&glb_mutex);
Expand All @@ -1496,6 +1500,8 @@ static void vmk80xx_disconnect(struct usb_interface *intf)
if (!dev)
return;

comedi_usb_auto_unconfig(dev->udev);

mutex_lock(&glb_mutex);
down(&dev->limit_sem);

Expand Down Expand Up @@ -1533,10 +1539,16 @@ static struct comedi_driver driver_vmk80xx = {

static int __init vmk80xx_init(void)
{
int retval;

printk(KERN_INFO "vmk80xx: version 0.8.01 "
"Manuel Gebele <forensixs@gmx.de>\n");
usb_register(&vmk80xx_driver);
return comedi_driver_register(&driver_vmk80xx);

retval = comedi_driver_register(&driver_vmk80xx);
if (retval < 0)
return retval;

return usb_register(&vmk80xx_driver);
}

static void __exit vmk80xx_exit(void)
Expand Down

0 comments on commit 8ba69ce

Please sign in to comment.