Commit 7c27ba46 authored by Fabio Estevam's avatar Fabio Estevam Committed by Mark Brown

ASoC: fsl_spdif: Use dev_name() for registering the irq

The 'name' array is currently stored inside the fsl_spdif_priv private structure
only for registering the interrupt name.

This can be simplified by registering it with dev_name() instead.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Acked-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 97bf6af1
...@@ -90,7 +90,6 @@ struct spdif_mixer_control { ...@@ -90,7 +90,6 @@ struct spdif_mixer_control {
* @sysclk: system clock for rx clock rate measurement * @sysclk: system clock for rx clock rate measurement
* @dma_params_tx: DMA parameters for transmit channel * @dma_params_tx: DMA parameters for transmit channel
* @dma_params_rx: DMA parameters for receive channel * @dma_params_rx: DMA parameters for receive channel
* @name: driver name
*/ */
struct fsl_spdif_priv { struct fsl_spdif_priv {
struct spdif_mixer_control fsl_spdif_control; struct spdif_mixer_control fsl_spdif_control;
...@@ -109,12 +108,8 @@ struct fsl_spdif_priv { ...@@ -109,12 +108,8 @@ struct fsl_spdif_priv {
struct clk *sysclk; struct clk *sysclk;
struct snd_dmaengine_dai_dma_data dma_params_tx; struct snd_dmaengine_dai_dma_data dma_params_tx;
struct snd_dmaengine_dai_dma_data dma_params_rx; struct snd_dmaengine_dai_dma_data dma_params_rx;
/* The name space will be allocated dynamically */
char name[0];
}; };
/* DPLL locked and lock loss interrupt handler */ /* DPLL locked and lock loss interrupt handler */
static void spdif_irq_dpll_lock(struct fsl_spdif_priv *spdif_priv) static void spdif_irq_dpll_lock(struct fsl_spdif_priv *spdif_priv)
{ {
...@@ -1169,19 +1164,15 @@ static int fsl_spdif_probe(struct platform_device *pdev) ...@@ -1169,19 +1164,15 @@ static int fsl_spdif_probe(struct platform_device *pdev)
if (!np) if (!np)
return -ENODEV; return -ENODEV;
spdif_priv = devm_kzalloc(&pdev->dev, spdif_priv = devm_kzalloc(&pdev->dev, sizeof(*spdif_priv), GFP_KERNEL);
sizeof(struct fsl_spdif_priv) + strlen(np->name) + 1,
GFP_KERNEL);
if (!spdif_priv) if (!spdif_priv)
return -ENOMEM; return -ENOMEM;
strcpy(spdif_priv->name, np->name);
spdif_priv->pdev = pdev; spdif_priv->pdev = pdev;
/* Initialize this copy of the CPU DAI driver structure */ /* Initialize this copy of the CPU DAI driver structure */
memcpy(&spdif_priv->cpu_dai_drv, &fsl_spdif_dai, sizeof(fsl_spdif_dai)); memcpy(&spdif_priv->cpu_dai_drv, &fsl_spdif_dai, sizeof(fsl_spdif_dai));
spdif_priv->cpu_dai_drv.name = spdif_priv->name; spdif_priv->cpu_dai_drv.name = dev_name(&pdev->dev);
/* Get the addresses and IRQ */ /* Get the addresses and IRQ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
...@@ -1203,7 +1194,7 @@ static int fsl_spdif_probe(struct platform_device *pdev) ...@@ -1203,7 +1194,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
} }
ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0, ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
spdif_priv->name, spdif_priv); dev_name(&pdev->dev), spdif_priv);
if (ret) { if (ret) {
dev_err(&pdev->dev, "could not claim irq %u\n", irq); dev_err(&pdev->dev, "could not claim irq %u\n", irq);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment