staging: comedi: 8255: use pointer to dev->subdevices
Instead of accessing the dev->subdevices directly as an array, use a pointer. This method is more common in the comedi subsystem. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
01bd3e3fc9
commit
e40e8375c0
1 changed files with 4 additions and 3 deletions
|
@ -371,6 +371,7 @@ EXPORT_SYMBOL(subdev_8255_cleanup);
|
||||||
static int dev_8255_attach(struct comedi_device *dev,
|
static int dev_8255_attach(struct comedi_device *dev,
|
||||||
struct comedi_devconfig *it)
|
struct comedi_devconfig *it)
|
||||||
{
|
{
|
||||||
|
struct comedi_subdevice *s;
|
||||||
int ret;
|
int ret;
|
||||||
unsigned long iobase;
|
unsigned long iobase;
|
||||||
int i;
|
int i;
|
||||||
|
@ -392,16 +393,16 @@ static int dev_8255_attach(struct comedi_device *dev,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (i = 0; i < dev->n_subdevices; i++) {
|
for (i = 0; i < dev->n_subdevices; i++) {
|
||||||
|
s = dev->subdevices + i;
|
||||||
iobase = it->options[i];
|
iobase = it->options[i];
|
||||||
|
|
||||||
if (!request_region(iobase, _8255_SIZE, "8255")) {
|
if (!request_region(iobase, _8255_SIZE, "8255")) {
|
||||||
dev_warn(dev->class_dev,
|
dev_warn(dev->class_dev,
|
||||||
"0x%04lx (I/O port conflict)\n", iobase);
|
"0x%04lx (I/O port conflict)\n", iobase);
|
||||||
|
|
||||||
dev->subdevices[i].type = COMEDI_SUBD_UNUSED;
|
s->type = COMEDI_SUBD_UNUSED;
|
||||||
} else {
|
} else {
|
||||||
subdev_8255_init(dev, dev->subdevices + i, NULL,
|
subdev_8255_init(dev, s, NULL, iobase);
|
||||||
iobase);
|
|
||||||
dev_info(dev->class_dev, "0x%04lx\n", iobase);
|
dev_info(dev->class_dev, "0x%04lx\n", iobase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue