* [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq
@ 2014-12-29 21:57 Fabio Estevam
2014-12-29 23:54 ` Nicolin Chen
2014-12-30 11:24 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-12-29 21:57 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_esai 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_esai.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 1c08ab1..dbe9204 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -44,7 +44,6 @@
* @sck_div: if using PSR/PM dividers for SCKx clock
* @slave_mode: if fully using DAI slave mode
* @synchronous: if using tx/rx synchronous mode
- * @name: driver name
*/
struct fsl_esai {
struct snd_dmaengine_dai_dma_data dma_params_rx;
@@ -63,7 +62,6 @@ struct fsl_esai {
bool sck_div[2];
bool slave_mode;
bool synchronous;
- char name[32];
};
static irqreturn_t esai_isr(int irq, void *devid)
@@ -739,7 +737,6 @@ static int fsl_esai_probe(struct platform_device *pdev)
return -ENOMEM;
esai_priv->pdev = pdev;
- strncpy(esai_priv->name, np->name, sizeof(esai_priv->name) - 1);
/* Get the addresses and IRQ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -779,7 +776,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
}
ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
- esai_priv->name, esai_priv);
+ dev_name(&pdev->dev), esai_priv);
if (ret) {
dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
return ret;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq
2014-12-29 21:57 [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq Fabio Estevam
@ 2014-12-29 23:54 ` Nicolin Chen
2014-12-30 1:24 ` Fabio Estevam
2014-12-30 11:24 ` Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Nicolin Chen @ 2014-12-29 23:54 UTC (permalink / raw)
To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, broonie
On Mon, Dec 29, 2014 at 07:57:26PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> The 'name' array is currently stored inside the fsl_esai 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>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
The name from dev_name() is a little different but doesn't matter.
The code looks neater now. I think we may also apply similar ones
to other drivers as well -- ASRC, SPDIF, etc. Would you like to
send the patches? Otherwise, I can do this instead :)
> ---
> sound/soc/fsl/fsl_esai.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> index 1c08ab1..dbe9204 100644
> --- a/sound/soc/fsl/fsl_esai.c
> +++ b/sound/soc/fsl/fsl_esai.c
> @@ -44,7 +44,6 @@
> * @sck_div: if using PSR/PM dividers for SCKx clock
> * @slave_mode: if fully using DAI slave mode
> * @synchronous: if using tx/rx synchronous mode
> - * @name: driver name
> */
> struct fsl_esai {
> struct snd_dmaengine_dai_dma_data dma_params_rx;
> @@ -63,7 +62,6 @@ struct fsl_esai {
> bool sck_div[2];
> bool slave_mode;
> bool synchronous;
> - char name[32];
> };
>
> static irqreturn_t esai_isr(int irq, void *devid)
> @@ -739,7 +737,6 @@ static int fsl_esai_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> esai_priv->pdev = pdev;
> - strncpy(esai_priv->name, np->name, sizeof(esai_priv->name) - 1);
>
> /* Get the addresses and IRQ */
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -779,7 +776,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
> }
>
> ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
> - esai_priv->name, esai_priv);
> + dev_name(&pdev->dev), esai_priv);
> if (ret) {
> dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
> return ret;
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq
2014-12-29 23:54 ` Nicolin Chen
@ 2014-12-30 1:24 ` Fabio Estevam
0 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-12-30 1:24 UTC (permalink / raw)
To: Nicolin Chen; +Cc: Fabio Estevam, alsa-devel@alsa-project.org, Mark Brown
On Mon, Dec 29, 2014 at 9:54 PM, Nicolin Chen <nicoleotsuka@gmail.com> wrote:
> On Mon, Dec 29, 2014 at 07:57:26PM -0200, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> The 'name' array is currently stored inside the fsl_esai 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>
>
> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
>
> The name from dev_name() is a little different but doesn't matter.
> The code looks neater now. I think we may also apply similar ones
> to other drivers as well -- ASRC, SPDIF, etc. Would you like to
> send the patches? Otherwise, I can do this instead :)
Good point. Will send patches for asrc and spdif as well. Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq
2014-12-29 21:57 [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq Fabio Estevam
2014-12-29 23:54 ` Nicolin Chen
@ 2014-12-30 11:24 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-12-30 11:24 UTC (permalink / raw)
To: Fabio Estevam; +Cc: nicoleotsuka, Fabio Estevam, alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 263 bytes --]
On Mon, Dec 29, 2014 at 07:57:26PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> The 'name' array is currently stored inside the fsl_esai private structure only
> for registering the interrupt name.
applied, 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:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 21:57 [PATCH] ASoC: fsl_esai: Use dev_name() for registering the irq Fabio Estevam
2014-12-29 23:54 ` Nicolin Chen
2014-12-30 1:24 ` Fabio Estevam
2014-12-30 11:24 ` 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.