summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaag Jadav <raag.jadav@intel.com>2025-02-12 09:25:11 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2025-02-24 13:08:52 +0300
commita0d78eec88395e67117a3453f55a4fc3c7265cf2 (patch)
treec02b97af9a6f5fc97b4841b9e0f5276cc8c42e84
parent86068aca754880715960a218410749b929c037bd (diff)
downloadlinux-a0d78eec88395e67117a3453f55a4fc3c7265cf2.tar.xz
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: Raag Jadav <raag.jadav@intel.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r--drivers/iio/adc/xilinx-xadc-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index cfbfcaefec0f..e1f8740ae688 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -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;