mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
staging: comedi: drivers: remove subdevice pointer math
Convert the comedi_subdevice access from pointer math to array access. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b077f2cd9b
commit
5e4c58ce65
1 changed files with 3 additions and 3 deletions
|
@ -71,7 +71,7 @@ int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices)
|
|||
dev->n_subdevices = num_subdevices;
|
||||
|
||||
for (i = 0; i < num_subdevices; ++i) {
|
||||
s = dev->subdevices + i;
|
||||
s = &dev->subdevices[i];
|
||||
s->device = dev;
|
||||
s->async_dma_dir = DMA_NONE;
|
||||
spin_lock_init(&s->spin_lock);
|
||||
|
@ -88,7 +88,7 @@ static void cleanup_device(struct comedi_device *dev)
|
|||
|
||||
if (dev->subdevices) {
|
||||
for (i = 0; i < dev->n_subdevices; i++) {
|
||||
s = dev->subdevices + i;
|
||||
s = &dev->subdevices[i];
|
||||
comedi_free_subdevice_minor(s);
|
||||
if (s->async) {
|
||||
comedi_buf_alloc(dev, s, 0);
|
||||
|
@ -260,7 +260,7 @@ static int postconfig(struct comedi_device *dev)
|
|||
int ret;
|
||||
|
||||
for (i = 0; i < dev->n_subdevices; i++) {
|
||||
s = dev->subdevices + i;
|
||||
s = &dev->subdevices[i];
|
||||
|
||||
if (s->type == COMEDI_SUBD_UNUSED)
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue