forked from Minki/linux
ASoC: atmel_ssc_dai: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0712e0288b
commit
e14614dc51
@ -1005,11 +1005,11 @@ static int asoc_ssc_init(struct device *dev)
|
|||||||
struct ssc_device *ssc = dev_get_drvdata(dev);
|
struct ssc_device *ssc = dev_get_drvdata(dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = snd_soc_register_component(dev, &atmel_ssc_component,
|
ret = devm_snd_soc_register_component(dev, &atmel_ssc_component,
|
||||||
&atmel_ssc_dai, 1);
|
&atmel_ssc_dai, 1);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "Could not register DAI: %d\n", ret);
|
dev_err(dev, "Could not register DAI: %d\n", ret);
|
||||||
goto err;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssc->pdata->use_dma)
|
if (ssc->pdata->use_dma)
|
||||||
@ -1019,15 +1019,10 @@ static int asoc_ssc_init(struct device *dev)
|
|||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "Could not register PCM: %d\n", ret);
|
dev_err(dev, "Could not register PCM: %d\n", ret);
|
||||||
goto err_unregister_dai;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_unregister_dai:
|
|
||||||
snd_soc_unregister_component(dev);
|
|
||||||
err:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void asoc_ssc_exit(struct device *dev)
|
static void asoc_ssc_exit(struct device *dev)
|
||||||
@ -1038,8 +1033,6 @@ static void asoc_ssc_exit(struct device *dev)
|
|||||||
atmel_pcm_dma_platform_unregister(dev);
|
atmel_pcm_dma_platform_unregister(dev);
|
||||||
else
|
else
|
||||||
atmel_pcm_pdc_platform_unregister(dev);
|
atmel_pcm_pdc_platform_unregister(dev);
|
||||||
|
|
||||||
snd_soc_unregister_component(dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user