[alsa-devel] [PATCH v2 0/2] fsl_ssi misc fix
Hi,
Changes in v2: - fix error path in probe - replace irq_of_parse_and_map with platform_get_irq
Changes in v1: - free IRQ before irq_dispose_mapping
Jiada Wang (2): ASoC: fsl_ssi: fix error path in probe ASoC: fsl_ssi: use platform_get_irq instead of irq_of_parse_and_map
sound/soc/fsl/fsl_ssi.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
SSI component isn't unregistered if fsl_ssi_debugfs_create() fails in probe phase.
To fix it, this commit replaces label error_asoc_register with error_irq.
Signed-off-by: Jiada Wang jiada_wang@mentor.com --- sound/soc/fsl/fsl_ssi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index e695517..e19ed39 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1412,7 +1412,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
ret = fsl_ssi_debugfs_create(&ssi_private->dbg_stats, &pdev->dev); if (ret) - goto error_asoc_register; + goto error_irq;
/* * If codec-handle property is missing from SSI node, we assume
Use platform_get_irq as no mapping needs to be done. By using platform_get_irq, driver can avoid to free IRQ manually when SSI driver exits.
Signed-off-by: Jiada Wang jiada_wang@mentor.com --- sound/soc/fsl/fsl_ssi.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index e19ed39..a7a9eb8 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1363,7 +1363,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) return PTR_ERR(ssi_private->regs); }
- ssi_private->irq = irq_of_parse_and_map(np, 0); + ssi_private->irq = platform_get_irq(pdev, 0); if (!ssi_private->irq) { dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); return -ENXIO; @@ -1389,7 +1389,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) if (ssi_private->soc->imx) { ret = fsl_ssi_imx_probe(pdev, ssi_private, iomem); if (ret) - goto error_irqmap; + return ret; }
ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, @@ -1460,10 +1460,6 @@ error_asoc_register: if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private);
-error_irqmap: - if (ssi_private->use_dma) - irq_dispose_mapping(ssi_private->irq); - return ret; }
@@ -1480,9 +1476,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private);
- if (ssi_private->use_dma) - irq_dispose_mapping(ssi_private->irq); - return 0; }
On Tue, Dec 02, 2014 at 02:55:07PM +0900, Jiada Wang wrote:
Use platform_get_irq as no mapping needs to be done. By using platform_get_irq, driver can avoid to free IRQ manually when SSI driver exits.
Fabio sent a version of this before yours so I applied his, I think the code is the same.
participants (2)
-
Jiada Wang
-
Mark Brown