]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00180236: mxc_spdif add spdif_clk error check
authorAdrian Alonso <aalonso@freescale.com>
Wed, 25 Apr 2012 23:03:50 +0000 (18:03 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:30 +0000 (08:34 +0200)
* Add get_clk clock error check
  abort driver probe if wrong clock.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
sound/soc/codecs/mxc_spdif.c

index 4d8e83b2032dbe2deccf8f875f85683884019d28..9a538c7295af0edd11b2b19a19e6da1ecf795517 100644 (file)
@@ -1244,6 +1244,11 @@ static int __devinit mxc_spdif_probe(struct platform_device *pdev)
        }
 
        plat_data->spdif_clk = clk_get(&pdev->dev, NULL);
+       if (IS_ERR(plat_data->spdif_clk)) {
+               ret = PTR_ERR(plat_data->spdif_clk);
+               dev_err(&pdev->dev, "can't get clock: %d\n", ret);
+               goto failed_clk;
+       }
 
        atomic_set(&spdif_priv->dpll_locked, 0);
 
@@ -1277,7 +1282,7 @@ static int __devinit mxc_spdif_probe(struct platform_device *pdev)
 card_err:
        clk_put(plat_data->spdif_clk);
        clk_disable(plat_data->spdif_core_clk);
-
+failed_clk:
        platform_set_drvdata(pdev, NULL);
        kfree(spdif_priv);