ASoC: fsi: take care in failing case of dai register
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 8 Apr 2011 06:09:02 +0000 (15:09 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 11 Apr 2011 20:14:09 +0000 (13:14 -0700)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/sh/fsi.c

index 0c9997e2d8c05d7407b63cff18b3786ad28b28fa..8e51a6eafbc37069896bc0b32d075dc2cae78a08 100644 (file)
@@ -1218,8 +1218,17 @@ static int fsi_probe(struct platform_device *pdev)
                goto exit_free_irq;
        }
 
-       return snd_soc_register_dais(&pdev->dev, fsi_soc_dai, ARRAY_SIZE(fsi_soc_dai));
+       ret = snd_soc_register_dais(&pdev->dev, fsi_soc_dai,
+                                   ARRAY_SIZE(fsi_soc_dai));
+       if (ret < 0) {
+               dev_err(&pdev->dev, "cannot snd dai register\n");
+               goto exit_snd_soc;
+       }
 
+       return ret;
+
+exit_snd_soc:
+       snd_soc_unregister_platform(&pdev->dev);
 exit_free_irq:
        free_irq(irq, master);
 exit_iounmap: