aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-04-09 19:27:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-11 15:47:52 -0400
commit1bdf7c2edfd2aa00f2a016fe997eb3297a02e1e5 (patch)
treedf886778e40dba302712e3e5c1c1d56c3c451e93 /drivers/staging
parent7b650090398c4e1508a1c4fd38bb744ecab584fa (diff)
staging: comedi: pcmmio: use comedi_request_region()
Use comedi_request_region() to request the I/O region used by this driver. Remove the noise when the board is first attached as well as the error message when the request_region() fails, comedi_request_reqion() will output the error message if necessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/pcmmio.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
index a342e3799c51..9166af996f16 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -1034,22 +1034,14 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
1034 struct comedi_subdevice *s; 1034 struct comedi_subdevice *s;
1035 int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic, 1035 int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic,
1036 thisasic_chanct = 0; 1036 thisasic_chanct = 0;
1037 unsigned long iobase;
1038 unsigned int irq[MAX_ASICS]; 1037 unsigned int irq[MAX_ASICS];
1039 int ret; 1038 int ret;
1040 1039
1041 iobase = it->options[0];
1042 irq[0] = it->options[1]; 1040 irq[0] = it->options[1];
1043 1041
1044 printk(KERN_INFO "comedi%d: %s: io: %lx attaching...\n", dev->minor, 1042 ret = comedi_request_region(dev, it->options[0], 32);
1045 dev->board_name, iobase); 1043 if (ret)
1046 1044 return ret;
1047 dev->iobase = iobase;
1048
1049 if (!iobase || !request_region(iobase, 32, dev->board_name)) {
1050 printk(KERN_ERR "comedi%d: I/O port conflict\n", dev->minor);
1051 return -EIO;
1052 }
1053 1045
1054 devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); 1046 devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
1055 if (!devpriv) 1047 if (!devpriv)
@@ -1206,8 +1198,6 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
1206 * multiple irqs.. 1198 * multiple irqs..
1207 */ 1199 */
1208 1200
1209 printk(KERN_INFO "comedi%d: attached\n", dev->minor);
1210
1211 return 1; 1201 return 1;
1212} 1202}
1213 1203