public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: gregkh@linuxfoundation.org, rafael@kernel.org,
	linus.walleij@linaro.org, mika.westerberg@linux.intel.com,
	andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com,
	lgirdwood@gmail.com, broonie@kernel.org, sre@kernel.org,
	jic23@kernel.org, przemyslaw.kitszel@intel.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, linux-sound@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
	Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v3 20/20] ASoC: uniphier: use devm_kmemdup_array()
Date: Mon,  3 Feb 2025 13:39:02 +0530	[thread overview]
Message-ID: <20250203080902.1864382-21-raag.jadav@intel.com> (raw)
In-Reply-To: <20250203080902.1864382-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 sound/soc/uniphier/aio-cpu.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c
index 470f129166a4..44f4053e5584 100644
--- a/sound/soc/uniphier/aio-cpu.c
+++ b/sound/soc/uniphier/aio-cpu.c
@@ -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(struct uniphier_aio_pll), 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];
-- 
2.34.1


  parent reply	other threads:[~2025-02-03  8:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  8:08 [PATCH v3 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
2025-02-03  8:08 ` [PATCH v3 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-05 16:27   ` kernel test robot
2025-02-06  6:13     ` Raag Jadav
2025-02-06 15:12       ` Andy Shevchenko
2025-02-06 15:14         ` Andy Shevchenko
2025-02-06 18:11           ` Raag Jadav
2025-02-06 18:56             ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 02/20] iio: imu: st_lsm9ds0: Replace device.h with what is needed Raag Jadav
2025-02-03 11:19   ` Jonathan Cameron
2025-02-03  8:08 ` [PATCH v3 03/20] devres: Introduce devm_kmemdup_array() Raag Jadav
2025-02-03  8:08 ` [PATCH v3 04/20] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
2025-02-03  8:08 ` [PATCH v3 05/20] pinctrl: baytrail: " Raag Jadav
2025-02-06 18:45   ` Linus Walleij
2025-02-03  8:08 ` [PATCH v3 06/20] pinctrl: cherryview: use devm_kmemdup_array() Raag Jadav
2025-02-06 18:46   ` Linus Walleij
2025-02-03  8:08 ` [PATCH v3 07/20] pinctrl: tangier: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 08/20] pinctrl: pxa2xx: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 09/20] input: sparse-keymap: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 10/20] input: ipaq-micro-keys: " Raag Jadav
2025-02-06 18:46   ` Linus Walleij
2025-02-03  8:08 ` [PATCH v3 11/20] regulator: devres: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 12/20] regulator: cros-ec: " Raag Jadav
2025-02-03  9:51   ` Andy Shevchenko
2025-02-03 10:40     ` Raag Jadav
2025-02-03 11:23       ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 13/20] power: supply: sc27xx: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 14/20] iio: adc: xilinx-xadc-core: " Raag Jadav
2025-02-03  9:54   ` Andy Shevchenko
2025-02-03 10:42     ` Raag Jadav
2025-02-03 11:14       ` Jonathan Cameron
2025-02-03 11:25         ` Andy Shevchenko
2025-02-03 11:24       ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 15/20] ASoC: Intel: avs: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 16/20] ASoC: hdac_hdmi: " Raag Jadav
2025-02-03  9:52   ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 17/20] ASoC: tlv320dac33: " Raag Jadav
2025-02-03  9:52   ` Andy Shevchenko
2025-02-03  8:09 ` [PATCH v3 18/20] ASoC: uda1380: " Raag Jadav
2025-02-03  9:57   ` Andy Shevchenko
2025-02-03  8:09 ` [PATCH v3 19/20] ASoC: meson: axg-tdm-interface: " Raag Jadav
2025-02-03  8:09 ` Raag Jadav [this message]
2025-02-03  9:53   ` [PATCH v3 20/20] ASoC: uniphier: " Andy Shevchenko
2025-02-03  9:48 ` [PATCH v3 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Andy Shevchenko
2025-02-03 10:34   ` Raag Jadav
2025-02-03 11:29     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250203080902.1864382-21-raag.jadav@intel.com \
    --to=raag.jadav@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rafael@kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox