summaryrefslogtreecommitdiff
path: root/sound/soc/mxs
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2011-11-22 23:52:21 +0800
committerShawn Guo <shawn.guo@linaro.org>2011-12-02 13:56:42 +0800
commit778825801d9dc3745417d295344b5b1e27de0d86 (patch)
tree368c01143b18c2b4a53229e4be2c40c04fd2b30c /sound/soc/mxs
parent5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff)
downloadlinux-3.10-778825801d9dc3745417d295344b5b1e27de0d86.tar.gz
linux-3.10-778825801d9dc3745417d295344b5b1e27de0d86.tar.bz2
linux-3.10-778825801d9dc3745417d295344b5b1e27de0d86.zip
ASoC: mxs-saif: remove function in platform_data
Add master_mode and master_id in platfrom_data since it's board specific and board knows it. Then we can remove the function pointer in platfrom_data to make the driver more devicetree friendly. Signed-off-by: Dong Aisheng <b29396@freescale.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'sound/soc/mxs')
-rw-r--r--sound/soc/mxs/mxs-saif.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 76dc74d24fc..1ef697fe173 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -625,13 +625,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
if (pdev->id >= ARRAY_SIZE(mxs_saif))
return -EINVAL;
- pdata = pdev->dev.platform_data;
- if (pdata && pdata->init) {
- ret = pdata->init();
- if (ret)
- return ret;
- }
-
saif = kzalloc(sizeof(*saif), GFP_KERNEL);
if (!saif)
return -ENOMEM;
@@ -639,12 +632,17 @@ static int mxs_saif_probe(struct platform_device *pdev)
mxs_saif[pdev->id] = saif;
saif->id = pdev->id;
- saif->master_id = saif->id;
- if (pdata && pdata->get_master_id) {
- saif->master_id = pdata->get_master_id(saif->id);
+ pdata = pdev->dev.platform_data;
+ if (pdata && !pdata->master_mode) {
+ saif->master_id = pdata->master_id;
if (saif->master_id < 0 ||
- saif->master_id >= ARRAY_SIZE(mxs_saif))
+ saif->master_id >= ARRAY_SIZE(mxs_saif) ||
+ saif->master_id == saif->id) {
+ dev_err(&pdev->dev, "get wrong master id\n");
return -EINVAL;
+ }
+ } else {
+ saif->master_id = saif->id;
}
saif->clk = clk_get(&pdev->dev, NULL);