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>
This commit is contained in:
Kuninori Morimoto 2014-03-02 23:43:18 -08:00 committed by Mark Brown
parent 468be93eb4
commit d1ac970f5d

View file

@ -814,7 +814,15 @@ static int rsnd_probe(struct platform_device *pdev)
struct rcar_snd_info *info; struct rcar_snd_info *info;
struct rsnd_priv *priv; struct rsnd_priv *priv;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int ret; int (*probe_func[])(struct platform_device *pdev,
struct rsnd_priv *priv) = {
rsnd_gen_probe,
rsnd_ssi_probe,
rsnd_scu_probe,
rsnd_adg_probe,
rsnd_dai_probe,
};
int ret, i;
info = pdev->dev.platform_data; info = pdev->dev.platform_data;
if (!info) { if (!info) {
@ -838,25 +846,11 @@ static int rsnd_probe(struct platform_device *pdev)
/* /*
* init each module * init each module
*/ */
ret = rsnd_gen_probe(pdev, priv); for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
if (ret) ret = probe_func[i](pdev, priv);
return ret; if (ret)
return ret;
ret = rsnd_ssi_probe(pdev, priv); }
if (ret)
return ret;
ret = rsnd_scu_probe(pdev, priv);
if (ret)
return ret;
ret = rsnd_adg_probe(pdev, priv);
if (ret)
return ret;
ret = rsnd_dai_probe(pdev, priv);
if (ret)
return ret;
/* /*
* asoc register * asoc register