chans_left = CHANS_PER_ASIC * thisboard->dio_num_asics;
n_dio_subdevs = CALC_N_DIO_SUBDEVS(chans_left);
n_subdevs = n_dio_subdevs + 2;
- devpriv->sprivs = (pcmmio_subdev_private *)kmalloc(sizeof(pcmmio_subdev_private) * n_subdevs, GFP_KERNEL);
+ devpriv->sprivs = kcalloc(n_subdevs, sizeof(pcmmio_subdev_private), GFP_KERNEL);
if (!devpriv->sprivs) {
printk("cannot allocate subdevice private data structures\n");
return -ENOMEM;
}
- memset(devpriv->sprivs, 0, sizeof(pcmmio_subdev_private) * n_subdevs);
/*
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
return -ENOMEM;
}
- memset(dev->subdevices, 0, sizeof(*dev->subdevices) * n_subdevs);
-
/* First, AI */
sdev_no = 0;
s = dev->subdevices + sdev_no;
chans_left = CHANS_PER_ASIC * thisboard->num_asics;
n_subdevs = CALC_N_SUBDEVS(chans_left);
- devpriv->sprivs = (pcmuio_subdev_private *)kmalloc(sizeof(pcmuio_subdev_private) * n_subdevs, GFP_KERNEL);
+ devpriv->sprivs = kcalloc(n_subdevs, sizeof(pcmuio_subdev_private), GFP_KERNEL);
if (!devpriv->sprivs) {
printk("cannot allocate subdevice private data structures\n");
return -ENOMEM;
}
- memset(devpriv->sprivs, 0, sizeof(pcmuio_subdev_private) * n_subdevs);
/*
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
return -ENOMEM;
}
- memset(dev->subdevices, 0, sizeof(*dev->subdevices) * n_subdevs);
-
port = 0;
asic = 0;
for (sdev_no = 0; sdev_no < (int)dev->n_subdevices; ++sdev_no)