staging:iio:dac: Fix kcalloc parameters swapped
authorAxel Lin <axel.lin@gmail.com>
Sat, 11 Feb 2012 01:00:48 +0000 (09:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2012 04:09:38 +0000 (20:09 -0800)
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/dac/ad5360.c
drivers/staging/iio/dac/ad5380.c

index 710b256..cec3693 100644 (file)
@@ -439,8 +439,8 @@ static int __devinit ad5360_alloc_channels(struct iio_dev *indio_dev)
        struct iio_chan_spec *channels;
        unsigned int i;
 
-       channels = kcalloc(sizeof(struct iio_chan_spec),
-                       st->chip_info->num_channels, GFP_KERNEL);
+       channels = kcalloc(st->chip_info->num_channels,
+                          sizeof(struct iio_chan_spec), GFP_KERNEL);
 
        if (!channels)
                return -ENOMEM;
index eff97ae..4c50716 100644 (file)
@@ -363,8 +363,8 @@ static int __devinit ad5380_alloc_channels(struct iio_dev *indio_dev)
        struct iio_chan_spec *channels;
        unsigned int i;
 
-       channels = kcalloc(sizeof(struct iio_chan_spec),
-                       st->chip_info->num_channels, GFP_KERNEL);
+       channels = kcalloc(st->chip_info->num_channels,
+                          sizeof(struct iio_chan_spec), GFP_KERNEL);
 
        if (!channels)
                return -ENOMEM;