Unverified Commit c173b5ee authored by Raag Jadav's avatar Raag Jadav Committed by Mark Brown
Browse files

ASoC: uniphier: use devm_kmemdup_array()



Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: default avatarRaag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-7-raag.jadav@intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b26205e1
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -762,14 +762,10 @@ int uniphier_aio_probe(struct platform_device *pdev)
		return -ENOMEM;

	chip->num_plls = chip->chip_spec->num_plls;
	chip->plls = devm_kcalloc(dev,
				  chip->num_plls,
				  sizeof(struct uniphier_aio_pll),
				  GFP_KERNEL);
	chip->plls = devm_kmemdup_array(dev, chip->chip_spec->plls, chip->num_plls,
					sizeof(*chip->chip_spec->plls), GFP_KERNEL);
	if (!chip->plls)
		return -ENOMEM;
	memcpy(chip->plls, chip->chip_spec->plls,
	       sizeof(struct uniphier_aio_pll) * chip->num_plls);

	for (i = 0; i < chip->num_aios; i++) {
		struct uniphier_aio *aio = &chip->aios[i];