Merge remote-tracking branch 'asoc/topic/samsung' into asoc-next
[profile/ivi/kernel-x86-ivi.git] / sound / soc / samsung / i2s.c
index 3e08b6c..a5cbdb4 100644 (file)
@@ -1055,7 +1055,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
        i2s->i2s_dai_drv.ops = &samsung_i2s_dai_ops;
        i2s->i2s_dai_drv.suspend = i2s_suspend;
        i2s->i2s_dai_drv.resume = i2s_resume;
-       i2s->i2s_dai_drv.playback.channels_min = 2;
+       i2s->i2s_dai_drv.playback.channels_min = 1;
        i2s->i2s_dai_drv.playback.channels_max = 2;
        i2s->i2s_dai_drv.playback.rates = SAMSUNG_I2S_RATES;
        i2s->i2s_dai_drv.playback.formats = SAMSUNG_I2S_FMTS;
@@ -1068,7 +1068,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
                dev_set_drvdata(&i2s->pdev->dev, i2s);
        } else {        /* Create a new platform_device for Secondary */
                i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1);
-               if (IS_ERR(i2s->pdev))
+               if (!i2s->pdev)
                        return NULL;
 
                i2s->pdev->dev.parent = &pdev->dev;
@@ -1138,9 +1138,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                        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);
+               devm_snd_soc_register_component(&sec_dai->pdev->dev,
+                                               &samsung_i2s_component,
+                                               &sec_dai->i2s_dai_drv, 1);
                samsung_asoc_dma_platform_register(&pdev->dev);
                return 0;
        }
@@ -1253,8 +1253,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                goto err;
        }
 
-       snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component,
-                                  &pri_dai->i2s_dai_drv, 1);
+       devm_snd_soc_register_component(&pri_dai->pdev->dev,
+                                       &samsung_i2s_component,
+                                       &pri_dai->i2s_dai_drv, 1);
 
        pm_runtime_enable(&pdev->dev);
 
@@ -1289,7 +1290,6 @@ static int samsung_i2s_remove(struct platform_device *pdev)
        i2s->sec_dai = NULL;
 
        samsung_asoc_dma_platform_unregister(&pdev->dev);
-       snd_soc_unregister_component(&pdev->dev);
 
        return 0;
 }