diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 19:19:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:47:40 -0400 |
commit | d6d0299000a63c617e0982baaac129a434b44cdf (patch) | |
tree | fdb2edad345bfe2280d876f510b23aa20b737a93 /drivers/staging | |
parent | 19b3da3e9182a62b9ac378c969b13ea44a202d47 (diff) |
staging: comedi: dt2817: 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/dt2817.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/dt2817.c b/drivers/staging/comedi/drivers/dt2817.c index 0dd6dd0f2a3d..92b461e73ef7 100644 --- a/drivers/staging/comedi/drivers/dt2817.c +++ b/drivers/staging/comedi/drivers/dt2817.c | |||
@@ -126,15 +126,10 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
126 | { | 126 | { |
127 | int ret; | 127 | int ret; |
128 | struct comedi_subdevice *s; | 128 | struct comedi_subdevice *s; |
129 | unsigned long iobase; | ||
130 | 129 | ||
131 | iobase = it->options[0]; | 130 | ret = comedi_request_region(dev, it->options[0], DT2817_SIZE); |
132 | printk(KERN_INFO "comedi%d: dt2817: 0x%04lx ", dev->minor, iobase); | 131 | if (ret) |
133 | if (!request_region(iobase, DT2817_SIZE, "dt2817")) { | 132 | return ret; |
134 | printk("I/O port conflict\n"); | ||
135 | return -EIO; | ||
136 | } | ||
137 | dev->iobase = iobase; | ||
138 | 133 | ||
139 | ret = comedi_alloc_subdevices(dev, 1); | 134 | ret = comedi_alloc_subdevices(dev, 1); |
140 | if (ret) | 135 | if (ret) |
@@ -153,8 +148,6 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
153 | s->state = 0; | 148 | s->state = 0; |
154 | outb(0, dev->iobase + DT2817_CR); | 149 | outb(0, dev->iobase + DT2817_CR); |
155 | 150 | ||
156 | printk(KERN_INFO "\n"); | ||
157 | |||
158 | return 0; | 151 | return 0; |
159 | } | 152 | } |
160 | 153 | ||