From 2a73cf9ff19110b578e7ce6808e8b3691382c3a5 Mon Sep 17 00:00:00 2001 From: Iulian Olaru Date: Wed, 22 Jul 2020 12:50:16 +0300 Subject: [PATCH] ASoC: SOF: imx8/imx8m: Replace sdev->private with sdev->pdata->hw_pdata The correct way to save private data is to use sdev->pdata->hw_pdata. Signed-off-by: Iulian Olaru --- sound/soc/sof/imx/imx8.c | 18 +++++++++--------- sound/soc/sof/imx/imx8m.c | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index f6d934f8358e49..066d005fe2d4b8 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -127,7 +127,7 @@ static struct imx_dsp_ops dsp_ops = { static int imx8_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) { - struct imx8_priv *priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *priv = (struct imx8_priv *)sdev->pdata->hw_pdata; sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, msg->msg_size); @@ -141,7 +141,7 @@ static int imx8_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) */ static int imx8x_run(struct snd_sof_dev *sdev) { - struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->pdata->hw_pdata; int ret; ret = imx_sc_misc_set_control(dsp_priv->sc_ipc, IMX_SC_R_DSP, @@ -181,7 +181,7 @@ static int imx8x_run(struct snd_sof_dev *sdev) static int imx8_run(struct snd_sof_dev *sdev) { - struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->pdata->hw_pdata; int ret; ret = imx_sc_misc_set_control(dsp_priv->sc_ipc, IMX_SC_R_DSP, @@ -214,7 +214,7 @@ static int imx8_probe(struct snd_sof_dev *sdev) if (!priv) return -ENOMEM; - sdev->private = priv; + sdev->pdata->hw_pdata = priv; priv->dev = sdev->dev; priv->sdev = sdev; @@ -346,7 +346,7 @@ static int imx8_probe(struct snd_sof_dev *sdev) static int imx8_remove(struct snd_sof_dev *sdev) { - struct imx8_priv *priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *priv = (struct imx8_priv *)sdev->pdata->hw_pdata; int i; platform_device_unregister(priv->ipc_dev); @@ -381,7 +381,7 @@ static int imx8_ipc_pcm_params(struct snd_sof_dev *sdev, int imx8_resume(struct snd_sof_dev *sdev) { - struct imx8_priv *priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *priv = (struct imx8_priv *)sdev->pdata->hw_pdata; int i; for (i = 0; i < DSP_MU_CHAN_NUM; i++) @@ -392,7 +392,7 @@ int imx8_resume(struct snd_sof_dev *sdev) int imx8_suspend(struct snd_sof_dev *sdev) { - struct imx8_priv *priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *priv = (struct imx8_priv *)sdev->pdata->hw_pdata; int i; for (i = 0; i < DSP_MU_CHAN_NUM; i++) @@ -414,7 +414,7 @@ int imx8_dsp_runtime_suspend(struct snd_sof_dev *sdev) int imx8_dsp_resume(struct snd_sof_dev *sdev) { - struct imx8_priv *priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *priv = (struct imx8_priv *)sdev->pdata->hw_pdata; if (priv->suspended) { imx8_resume(sdev); @@ -426,7 +426,7 @@ int imx8_dsp_resume(struct snd_sof_dev *sdev) int imx8_dsp_suspend(struct snd_sof_dev *sdev) { - struct imx8_priv *priv = (struct imx8_priv *)sdev->private; + struct imx8_priv *priv = (struct imx8_priv *)sdev->pdata->hw_pdata; if (!priv->suspended) { imx8_suspend(sdev); diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c index a081633ac37655..1413250a3d1c2b 100644 --- a/sound/soc/sof/imx/imx8m.c +++ b/sound/soc/sof/imx/imx8m.c @@ -162,7 +162,7 @@ static struct imx_dsp_ops dsp_ops = { static int imx8m_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) { - struct imx8m_priv *priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, msg->msg_size); @@ -176,7 +176,7 @@ static int imx8m_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) */ static int imx8m_run(struct snd_sof_dev *sdev) { - struct imx8m_priv *dsp_priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *dsp_priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; imx_audiomix_dsp_start(dsp_priv->audiomix); @@ -185,7 +185,7 @@ static int imx8m_run(struct snd_sof_dev *sdev) static int imx8m_reset(struct snd_sof_dev *sdev) { - struct imx8m_priv *dsp_priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *dsp_priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; u32 pwrctl; /* put DSP into reset and stall */ @@ -223,7 +223,7 @@ static int imx8m_probe(struct snd_sof_dev *sdev) if (!priv) return -ENOMEM; - sdev->private = priv; + sdev->pdata->hw_pdata = priv; priv->dev = sdev->dev; priv->sdev = sdev; @@ -366,7 +366,7 @@ static int imx8m_probe(struct snd_sof_dev *sdev) static int imx8m_remove(struct snd_sof_dev *sdev) { - struct imx8m_priv *priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; int i; platform_device_unregister(priv->ipc_dev); @@ -410,7 +410,7 @@ static struct snd_soc_dai_driver imx8m_dai[] = { int imx8m_resume(struct snd_sof_dev *sdev) { - struct imx8m_priv *priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; int i; for (i = 0; i < IMX8M_DSP_CLK_NUM; i++) @@ -424,7 +424,7 @@ int imx8m_resume(struct snd_sof_dev *sdev) int imx8m_suspend(struct snd_sof_dev *sdev) { - struct imx8m_priv *priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; int i; for (i = 0; i < DSP_MU_CHAN_NUM; i++) @@ -448,7 +448,7 @@ static int imx8m_dsp_runtime_suspend(struct snd_sof_dev *sdev) static int imx8m_dsp_resume(struct snd_sof_dev *sdev) { - struct imx8m_priv *priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; if (priv->suspended) { imx8m_resume(sdev); @@ -460,7 +460,7 @@ static int imx8m_dsp_resume(struct snd_sof_dev *sdev) static int imx8m_dsp_suspend(struct snd_sof_dev *sdev) { - struct imx8m_priv *priv = (struct imx8m_priv *)sdev->private; + struct imx8m_priv *priv = (struct imx8m_priv *)sdev->pdata->hw_pdata; if (!priv->suspended) { imx8m_suspend(sdev);