Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317309
b: refs/heads/master
c: 03afcf4
h: refs/heads/master
i:
  317307: 0d5fdee
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent 260b592 commit 2a2db49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b6c56949ffa83dbc2a6e8fa3f98b10a19372207
refs/heads/master: 03afcf472785a63d720202d28d51852d965a95d9
19 changes: 11 additions & 8 deletions trunk/drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,24 @@ struct comedi_driver *comedi_drivers;

int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices)
{
struct comedi_subdevice *s;
int i;

if (num_subdevices < 1)
return -EINVAL;
dev->subdevices =
kcalloc(num_subdevices, sizeof(struct comedi_subdevice),
GFP_KERNEL);
if (!dev->subdevices)

s = kcalloc(num_subdevices, sizeof(*s), GFP_KERNEL);
if (!s)
return -ENOMEM;
dev->subdevices = s;
dev->n_subdevices = num_subdevices;

for (i = 0; i < num_subdevices; ++i) {
dev->subdevices[i].device = dev;
dev->subdevices[i].async_dma_dir = DMA_NONE;
spin_lock_init(&dev->subdevices[i].spin_lock);
dev->subdevices[i].minor = -1;
s = dev->subdevices + i;
s->device = dev;
s->async_dma_dir = DMA_NONE;
spin_lock_init(&s->spin_lock);
s->minor = -1;
}
return 0;
}
Expand Down

0 comments on commit 2a2db49

Please sign in to comment.