Commit a0d78eec authored by Raag Jadav's avatar Raag Jadav Committed by Andy Shevchenko
Browse files

iio: adc: xilinx-xadc-core: use devm_kmemdup_array()



Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: default avatarRaag Jadav <raag.jadav@intel.com>
Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 86068aca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1245,8 +1245,8 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
		channel_templates = xadc_us_channels;
		max_channels = ARRAY_SIZE(xadc_us_channels);
	}
	channels = devm_kmemdup(dev, channel_templates,
				sizeof(channels[0]) * max_channels, GFP_KERNEL);
	channels = devm_kmemdup_array(dev, channel_templates, max_channels,
				      sizeof(*channel_templates), GFP_KERNEL);
	if (!channels)
		return -ENOMEM;