Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337586
b: refs/heads/master
c: 6b3aa31
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Jonathan Cameron committed Oct 31, 2012
1 parent 577cc1f commit 91e47d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 2b0c856ad9571013db8fc369194b7108dff3c18e
refs/heads/master: 6b3aa3131a7804640e7589e5629036f660362f0b
16 changes: 10 additions & 6 deletions trunk/drivers/iio/adc/at91_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ static int at91_adc_channel_init(struct iio_dev *idev)
idev->num_channels = bitmap_weight(&st->channels_mask,
st->num_channels) + 1;

chan_array = devm_kcalloc(&idev->dev, idev->num_channels + 1,
sizeof(*chan_array), GFP_KERNEL);
chan_array = devm_kzalloc(&idev->dev,
((idev->num_channels + 1) *
sizeof(struct iio_chan_spec)),
GFP_KERNEL);

if (!chan_array)
return -ENOMEM;
Expand Down Expand Up @@ -268,8 +270,9 @@ static int at91_adc_trigger_init(struct iio_dev *idev)
struct at91_adc_state *st = iio_priv(idev);
int i, ret;

st->trig = devm_kcalloc(&idev->dev, st->trigger_number,
sizeof(*st->trig), GFP_KERNEL);
st->trig = devm_kzalloc(&idev->dev,
st->trigger_number * sizeof(st->trig),
GFP_KERNEL);

if (st->trig == NULL) {
ret = -ENOMEM;
Expand Down Expand Up @@ -451,8 +454,9 @@ static int at91_adc_probe_dt(struct at91_adc_state *st,
st->registers->trigger_register = prop;

st->trigger_number = of_get_child_count(node);
st->trigger_list = devm_kcalloc(&idev->dev, st->trigger_number,
sizeof(*st->trigger_list), GFP_KERNEL);
st->trigger_list = devm_kzalloc(&idev->dev, st->trigger_number *
sizeof(struct at91_adc_trigger),
GFP_KERNEL);
if (!st->trigger_list) {
dev_err(&idev->dev, "Could not allocate trigger list memory.\n");
ret = -ENOMEM;
Expand Down

0 comments on commit 91e47d4

Please sign in to comment.