[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250228062812.150004-6-raag.jadav@intel.com>
Date: Fri, 28 Feb 2025 11:58:11 +0530
From: Raag Jadav <raag.jadav@...el.com>
To: perex@...ex.cz,
tiwai@...e.com,
broonie@...nel.org,
lgirdwood@...il.com,
andriy.shevchenko@...ux.intel.com,
cezary.rojewski@...el.com,
amadeuszx.slawinski@...ux.intel.com,
shenghao-ding@...com,
kevin-lu@...com,
baojun.xu@...com,
jbrunet@...libre.com,
neil.armstrong@...aro.org,
khilman@...libre.com,
hayashi.kunihiko@...ionext.com,
mhiramat@...nel.org
Cc: linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v2 5/6] ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@...el.com>
---
sound/soc/meson/axg-tdm-interface.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c
index 09103eef2a97..421b5d719fb3 100644
--- a/sound/soc/meson/axg-tdm-interface.c
+++ b/sound/soc/meson/axg-tdm-interface.c
@@ -529,7 +529,6 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct snd_soc_dai_driver *dai_drv;
struct axg_tdm_iface *iface;
- int i;
iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL);
if (!iface)
@@ -541,15 +540,11 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
* We'll change the number of channel provided by DAI stream, so dpcm
* channel merge can be done properly
*/
- dai_drv = devm_kcalloc(dev, ARRAY_SIZE(axg_tdm_iface_dai_drv),
- sizeof(*dai_drv), GFP_KERNEL);
+ dai_drv = devm_kmemdup_array(dev, axg_tdm_iface_dai_drv, ARRAY_SIZE(axg_tdm_iface_dai_drv),
+ sizeof(axg_tdm_iface_dai_drv[0]), GFP_KERNEL);
if (!dai_drv)
return -ENOMEM;
- for (i = 0; i < ARRAY_SIZE(axg_tdm_iface_dai_drv); i++)
- memcpy(&dai_drv[i], &axg_tdm_iface_dai_drv[i],
- sizeof(*dai_drv));
-
/* Bit clock provided on the pad */
iface->sclk = devm_clk_get(dev, "sclk");
if (IS_ERR(iface->sclk))
--
2.34.1
Powered by blists - more mailing lists