]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: core: Merge Samsung fixes to avoid trivial context conflict
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 3 Apr 2013 17:22:44 +0000 (18:22 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 3 Apr 2013 17:22:51 +0000 (18:22 +0100)
Merge branch 'fix/samsung' of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into
asoc-component to resolve trivial conflict

Conflicts:
sound/soc/samsung/i2s.c

1  2 
sound/soc/samsung/i2s.c

diff --combined sound/soc/samsung/i2s.c
index efa73147dfb8be9472f5d2d724dff71bc144a5fc,6bbeb0bf1a73a58fa9e3a573e00655dc3e8763d2..abbcbe4b429c48c96c8d859b3f7035a92d05a474
@@@ -963,10 -963,6 +963,10 @@@ static const struct snd_soc_dai_ops sam
        .delay = i2s_delay,
  };
  
 +static const struct snd_soc_component_driver samsung_i2s_component = {
 +      .name           = "samsung-i2s",
 +};
 +
  #define SAMSUNG_I2S_RATES     SNDRV_PCM_RATE_8000_96000
  
  #define SAMSUNG_I2S_FMTS      (SNDRV_PCM_FMTBIT_S8 | \
  static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
  {
        struct i2s_dai *i2s;
+       int ret;
  
        i2s = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dai), GFP_KERNEL);
        if (i2s == NULL)
                i2s->i2s_dai_drv.capture.channels_max = 2;
                i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES;
                i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS;
+               dev_set_drvdata(&i2s->pdev->dev, i2s);
        } else {        /* Create a new platform_device for Secondary */
-               i2s->pdev = platform_device_register_resndata(NULL,
-                               "samsung-i2s-sec", -1, NULL, 0, NULL, 0);
+               i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1);
                if (IS_ERR(i2s->pdev))
                        return NULL;
-       }
  
-       /* Pre-assign snd_soc_dai_set_drvdata */
-       dev_set_drvdata(&i2s->pdev->dev, i2s);
+               platform_set_drvdata(i2s->pdev, i2s);
+               ret = platform_device_add(i2s->pdev);
+               if (ret < 0)
+                       return NULL;
+       }
  
        return i2s;
  }
@@@ -1111,9 -1110,12 +1114,13 @@@ static int samsung_i2s_probe(struct pla
  
        if (samsung_dai_type == TYPE_SEC) {
                sec_dai = dev_get_drvdata(&pdev->dev);
 -              snd_soc_register_dai(&sec_dai->pdev->dev,
 -                      &sec_dai->i2s_dai_drv);
+               if (!sec_dai) {
+                       dev_err(&pdev->dev, "Unable to get drvdata\n");
+                       return -EFAULT;
+               }
 +              snd_soc_register_component(&sec_dai->pdev->dev,
 +                                         &samsung_i2s_component,
 +                                         &sec_dai->i2s_dai_drv, 1);
                asoc_dma_platform_register(&pdev->dev);
                return 0;
        }
                }
        }
  
 -      snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv);
 +      snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component,
 +                                 &pri_dai->i2s_dai_drv, 1);
  
        pm_runtime_enable(&pdev->dev);
  
@@@ -1282,7 -1283,7 +1289,7 @@@ static int samsung_i2s_remove(struct pl
        i2s->sec_dai = NULL;
  
        asoc_dma_platform_unregister(&pdev->dev);
 -      snd_soc_unregister_dai(&pdev->dev);
 +      snd_soc_unregister_component(&pdev->dev);
  
        return 0;
  }