All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq
@ 2014-12-30  1:52 Fabio Estevam
  2014-12-30  1:52 ` [PATCH 2/2] ASoC: fsl_asrc: " Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-12-30  1:52 UTC (permalink / raw)
  To: broonie; +Cc: nicoleotsuka, Fabio Estevam, alsa-devel

From: Fabio Estevam <fabio.estevam@freescale.com>

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: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/fsl_spdif.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index af042942..73da1f0 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -90,7 +90,6 @@ struct spdif_mixer_control {
  * @sysclk: system clock for rx clock rate measurement
  * @dma_params_tx: DMA parameters for transmit channel
  * @dma_params_rx: DMA parameters for receive channel
- * @name: driver name
  */
 struct fsl_spdif_priv {
 	struct spdif_mixer_control fsl_spdif_control;
@@ -109,12 +108,8 @@ struct fsl_spdif_priv {
 	struct clk *sysclk;
 	struct snd_dmaengine_dai_dma_data dma_params_tx;
 	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 */
 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)
 	if (!np)
 		return -ENODEV;
 
-	spdif_priv = devm_kzalloc(&pdev->dev,
-			sizeof(struct fsl_spdif_priv) + strlen(np->name) + 1,
-			GFP_KERNEL);
+	spdif_priv = devm_kzalloc(&pdev->dev, sizeof(*spdif_priv), GFP_KERNEL);
 	if (!spdif_priv)
 		return -ENOMEM;
 
-	strcpy(spdif_priv->name, np->name);
-
 	spdif_priv->pdev = pdev;
 
 	/* Initialize this copy of the CPU DAI driver structure */
 	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 */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1203,7 +1194,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
-			spdif_priv->name, spdif_priv);
+			       dev_name(&pdev->dev), spdif_priv);
 	if (ret) {
 		dev_err(&pdev->dev, "could not claim irq %u\n", irq);
 		return ret;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ASoC: fsl_asrc: Use dev_name() for registering the irq
  2014-12-30  1:52 [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq Fabio Estevam
@ 2014-12-30  1:52 ` Fabio Estevam
  2014-12-30  3:06 ` [PATCH 1/2] ASoC: fsl_spdif: " Nicolin Chen
  2014-12-30 11:27 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-12-30  1:52 UTC (permalink / raw)
  To: broonie; +Cc: nicoleotsuka, Fabio Estevam, alsa-devel

From: Fabio Estevam <fabio.estevam@freescale.com>

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

This can be simplified by registering it with dev_name() instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/fsl_asrc.c | 3 +--
 sound/soc/fsl/fsl_asrc.h | 3 ---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 026a801..5326ca7 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -818,7 +818,6 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	asrc_priv->pdev = pdev;
-	strncpy(asrc_priv->name, np->name, sizeof(asrc_priv->name) - 1);
 
 	/* Get the addresses and IRQ */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -842,7 +841,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
-			       asrc_priv->name, asrc_priv);
+			       dev_name(&pdev->dev), asrc_priv);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to claim irq %u: %d\n", irq, ret);
 		return ret;
diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h
index a3f211f..4aed63c 100644
--- a/sound/soc/fsl/fsl_asrc.h
+++ b/sound/soc/fsl/fsl_asrc.h
@@ -433,7 +433,6 @@ struct fsl_asrc_pair {
  * @channel_avail: non-occupied channel numbers
  * @asrc_rate: default sample rate for ASoC Back-Ends
  * @asrc_width: default sample width for ASoC Back-Ends
- * @name: driver name
  */
 struct fsl_asrc {
 	struct snd_dmaengine_dai_dma_data dma_params_rx;
@@ -452,8 +451,6 @@ struct fsl_asrc {
 
 	int asrc_rate;
 	int asrc_width;
-
-	char name[32];
 };
 
 extern struct snd_soc_platform_driver fsl_asrc_platform;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq
  2014-12-30  1:52 [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq Fabio Estevam
  2014-12-30  1:52 ` [PATCH 2/2] ASoC: fsl_asrc: " Fabio Estevam
@ 2014-12-30  3:06 ` Nicolin Chen
  2014-12-30 11:27 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolin Chen @ 2014-12-30  3:06 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, broonie

On Mon, Dec 29, 2014 at 11:52:35PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> 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: Fabio Estevam <fabio.estevam@freescale.com>

For both patches.

Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

Thank you
Nicolin

> ---
>  sound/soc/fsl/fsl_spdif.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
> index af042942..73da1f0 100644
> --- a/sound/soc/fsl/fsl_spdif.c
> +++ b/sound/soc/fsl/fsl_spdif.c
> @@ -90,7 +90,6 @@ struct spdif_mixer_control {
>   * @sysclk: system clock for rx clock rate measurement
>   * @dma_params_tx: DMA parameters for transmit channel
>   * @dma_params_rx: DMA parameters for receive channel
> - * @name: driver name
>   */
>  struct fsl_spdif_priv {
>  	struct spdif_mixer_control fsl_spdif_control;
> @@ -109,12 +108,8 @@ struct fsl_spdif_priv {
>  	struct clk *sysclk;
>  	struct snd_dmaengine_dai_dma_data dma_params_tx;
>  	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 */
>  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)
>  	if (!np)
>  		return -ENODEV;
>  
> -	spdif_priv = devm_kzalloc(&pdev->dev,
> -			sizeof(struct fsl_spdif_priv) + strlen(np->name) + 1,
> -			GFP_KERNEL);
> +	spdif_priv = devm_kzalloc(&pdev->dev, sizeof(*spdif_priv), GFP_KERNEL);
>  	if (!spdif_priv)
>  		return -ENOMEM;
>  
> -	strcpy(spdif_priv->name, np->name);
> -
>  	spdif_priv->pdev = pdev;
>  
>  	/* Initialize this copy of the CPU DAI driver structure */
>  	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 */
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1203,7 +1194,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
>  	}
>  
>  	ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
> -			spdif_priv->name, spdif_priv);
> +			       dev_name(&pdev->dev), spdif_priv);
>  	if (ret) {
>  		dev_err(&pdev->dev, "could not claim irq %u\n", irq);
>  		return ret;
> -- 
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq
  2014-12-30  1:52 [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq Fabio Estevam
  2014-12-30  1:52 ` [PATCH 2/2] ASoC: fsl_asrc: " Fabio Estevam
  2014-12-30  3:06 ` [PATCH 1/2] ASoC: fsl_spdif: " Nicolin Chen
@ 2014-12-30 11:27 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-12-30 11:27 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: nicoleotsuka, Fabio Estevam, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 274 bytes --]

On Mon, Dec 29, 2014 at 11:52:35PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> The 'name' array is currently stored inside the fsl_spdif_priv private structure
> only for registering the interrupt name.

Applied both, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-30 11:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30  1:52 [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq Fabio Estevam
2014-12-30  1:52 ` [PATCH 2/2] ASoC: fsl_asrc: " Fabio Estevam
2014-12-30  3:06 ` [PATCH 1/2] ASoC: fsl_spdif: " Nicolin Chen
2014-12-30 11:27 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.