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)
* 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))