Commit 9a054c27 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: dt9812: do not allow attaching to unsupported devices

The DT9812 is part of the ECONseries of USB Data Acquisition Modules.
This driver only supports the DT9812-10V and DT9812-2.5V versions of
the module. Do not attach to the device if an unsupported module is
detected.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d6caedf0
......@@ -768,6 +768,12 @@ static int dt9812_reset_device(struct comedi_device *dev)
dev_info(dev->class_dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n",
vendor, product, devpriv->device, serial);
if (devpriv->device != DT9812_DEVID_DT9812_10 &&
devpriv->device != DT9812_DEVID_DT9812_2PT5) {
dev_err(dev->class_dev, "Unsupported device!\n");
return -EINVAL;
}
return 0;
}
......
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