diff options
author | 2012-06-12 11:59:33 -0700 | |
---|---|---|
committer | 2012-06-12 14:44:04 -0700 | |
commit | 8b6c56949ffa83dbc2a6e8fa3f98b10a19372207 (patch) | |
tree | 71fb0a053eca4f23efdca55f479554ba037ee987 /drivers/staging/comedi/drivers/pcl730.c | |
parent | staging: comedi: remove the "Allocate the subdevice..." comments (diff) | |
download | linux-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/pcl730.c')
-rw-r--r-- | drivers/staging/comedi/drivers/pcl730.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/pcl730.c b/drivers/staging/comedi/drivers/pcl730.c index e258bcebf198..3cba79a219b8 100644 --- a/drivers/staging/comedi/drivers/pcl730.c +++ b/drivers/staging/comedi/drivers/pcl730.c @@ -72,6 +72,7 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct comedi_subdevice *s; unsigned long iobase; unsigned int iorange; + int ret; iobase = it->options[0]; iorange = board->io_range; @@ -85,8 +86,9 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev->iobase = iobase; dev->irq = 0; - if (comedi_alloc_subdevices(dev, 4) < 0) - return -ENOMEM; + ret = comedi_alloc_subdevices(dev, 4); + if (ret) + return ret; s = dev->subdevices + 0; /* Isolated do */ |