aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/adl_pci7432.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-06-12 11:59:33 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-12 14:44:04 -0700
commit8b6c56949ffa83dbc2a6e8fa3f98b10a19372207 (patch)
tree71fb0a053eca4f23efdca55f479554ba037ee987 /drivers/staging/comedi/drivers/adl_pci7432.c
parentstaging: comedi: remove the "Allocate the subdevice..." comments (diff)
downloadlinux-dev-8b6c56949ffa83dbc2a6e8fa3f98b10a19372207.tar.xz
linux-dev-8b6c56949ffa83dbc2a6e8fa3f98b10a19372207.zip
staging: comedi: propogate error code from comedi_alloc_subdevices
comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it does fail make sure to pass the proper error code back. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbott@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/adl_pci7432.c')
-rw-r--r--drivers/staging/comedi/drivers/adl_pci7432.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci7432.c b/drivers/staging/comedi/drivers/adl_pci7432.c
index 4976a70fb1e4..aabf4183aaf5 100644
--- a/drivers/staging/comedi/drivers/adl_pci7432.c
+++ b/drivers/staging/comedi/drivers/adl_pci7432.c
@@ -117,6 +117,7 @@ static int adl_pci7432_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
+ int ret;
printk(KERN_INFO "comedi%d: attach adl_pci7432\n", dev->minor);
@@ -125,8 +126,9 @@ static int adl_pci7432_attach(struct comedi_device *dev,
if (alloc_private(dev, sizeof(struct adl_pci7432_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
devpriv->pci_dev = adl_pci7432_find_pci(dev, it);
if (!devpriv->pci_dev)