From 5fddf88f6e2544ceb3c7c28b506a01f7934c1b3a Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 25 Jan 2013 15:02:06 -0700 Subject: [PATCH] --- yaml --- r: 354237 b: refs/heads/master c: c65c64d0f0b269b1239fdce253fd4717281cc98d h: refs/heads/master i: 354235: dd63a8b518c174143789511cb998139e5c62679c v: v3 --- [refs] | 2 +- .../staging/comedi/drivers/quatech_daqp_cs.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index db719ae2792c..539d9871ebff 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e23fe9a1bf80eee77d4cc97504bcec0c40ed973d +refs/heads/master: c65c64d0f0b269b1239fdce253fd4717281cc98d diff --git a/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c index 185632e70b97..2a5f9ab6f7c1 100644 --- a/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c +++ b/trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c @@ -733,15 +733,16 @@ static int daqp_do_insn_write(struct comedi_device *dev, static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - int ret; - struct local_info_t *local = dev_table[it->options[0]]; + struct local_info_t *local; struct comedi_subdevice *s; + int ret; - if (it->options[0] < 0 || it->options[0] >= MAX_DEV || !local) { - dev_err(dev->class_dev, "No such daqp device %d\n", - it->options[0]); - return -EIO; - } + if (it->options[0] < 0 || it->options[0] >= MAX_DEV) + return -ENODEV; + + local = dev_table[it->options[0]]; + if (!local) + return -ENODEV; /* Typically brittle code that I don't completely understand, * but "it works on my card". The intent is to pull the model