aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-03-03 02:43:18 -0500
committerMark Brown <broonie@linaro.org>2014-03-03 23:13:49 -0500
commitd1ac970f5de94bef9e094b46f016899d04e8178b (patch)
tree62554bd56c8e28bf068bb622f9bffb1c5807c88b /sound/soc
parent468be93eb4e28c5710ed8acc1b938937707e537c (diff)
ASoC: rsnd: use function pointer for each probe
R-Car sound consists of many devices. It will have more device support in the future. Thus, for each probe become now function pointer array. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/sh/rcar/core.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 416b0782503a..ea747614fbf8 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -814,7 +814,15 @@ static int rsnd_probe(struct platform_device *pdev)
814 struct rcar_snd_info *info; 814 struct rcar_snd_info *info;
815 struct rsnd_priv *priv; 815 struct rsnd_priv *priv;
816 struct device *dev = &pdev->dev; 816 struct device *dev = &pdev->dev;
817 int ret; 817 int (*probe_func[])(struct platform_device *pdev,
818 struct rsnd_priv *priv) = {
819 rsnd_gen_probe,
820 rsnd_ssi_probe,
821 rsnd_scu_probe,
822 rsnd_adg_probe,
823 rsnd_dai_probe,
824 };
825 int ret, i;
818 826
819 info = pdev->dev.platform_data; 827 info = pdev->dev.platform_data;
820 if (!info) { 828 if (!info) {
@@ -838,25 +846,11 @@ static int rsnd_probe(struct platform_device *pdev)
838 /* 846 /*
839 * init each module 847 * init each module
840 */ 848 */
841 ret = rsnd_gen_probe(pdev, priv); 849 for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
842 if (ret) 850 ret = probe_func[i](pdev, priv);
843 return ret; 851 if (ret)
844 852 return ret;
845 ret = rsnd_ssi_probe(pdev, priv); 853 }
846 if (ret)
847 return ret;
848
849 ret = rsnd_scu_probe(pdev, priv);
850 if (ret)
851 return ret;
852
853 ret = rsnd_adg_probe(pdev, priv);
854 if (ret)
855 return ret;
856
857 ret = rsnd_dai_probe(pdev, priv);
858 if (ret)
859 return ret;
860 854
861 /* 855 /*
862 * asoc register 856 * asoc register