mirror of
https://github.com/torvalds/linux
synced 2024-10-20 02:09:15 +00:00
ASoC: qdsp6: q6asm: use of_platform_populate/depopulate()
Now that the child nodes have there own compatible strings, Use of_platform_populate/depopulate() instead of less common of_platform_device_create()/destroy(). Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f614c9b070
commit
4aac7e2773
|
@ -177,7 +177,6 @@ struct q6asm {
|
||||||
struct platform_device *pcmdev;
|
struct platform_device *pcmdev;
|
||||||
spinlock_t slock;
|
spinlock_t slock;
|
||||||
struct audio_client *session[MAX_SESSIONS + 1];
|
struct audio_client *session[MAX_SESSIONS + 1];
|
||||||
struct platform_device *pdev_dais;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct audio_client {
|
struct audio_client {
|
||||||
|
@ -1344,7 +1343,6 @@ EXPORT_SYMBOL_GPL(q6asm_cmd_nowait);
|
||||||
static int q6asm_probe(struct apr_device *adev)
|
static int q6asm_probe(struct apr_device *adev)
|
||||||
{
|
{
|
||||||
struct device *dev = &adev->dev;
|
struct device *dev = &adev->dev;
|
||||||
struct device_node *dais_np;
|
|
||||||
struct q6asm *q6asm;
|
struct q6asm *q6asm;
|
||||||
|
|
||||||
q6asm = devm_kzalloc(dev, sizeof(*q6asm), GFP_KERNEL);
|
q6asm = devm_kzalloc(dev, sizeof(*q6asm), GFP_KERNEL);
|
||||||
|
@ -1359,22 +1357,12 @@ static int q6asm_probe(struct apr_device *adev)
|
||||||
spin_lock_init(&q6asm->slock);
|
spin_lock_init(&q6asm->slock);
|
||||||
dev_set_drvdata(dev, q6asm);
|
dev_set_drvdata(dev, q6asm);
|
||||||
|
|
||||||
dais_np = of_get_child_by_name(dev->of_node, "dais");
|
return of_platform_populate(dev->of_node, NULL, NULL, dev);
|
||||||
if (dais_np) {
|
|
||||||
q6asm->pdev_dais = of_platform_device_create(dais_np,
|
|
||||||
"q6asm-dai", dev);
|
|
||||||
of_node_put(dais_np);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int q6asm_remove(struct apr_device *adev)
|
static int q6asm_remove(struct apr_device *adev)
|
||||||
{
|
{
|
||||||
struct q6asm *q6asm = dev_get_drvdata(&adev->dev);
|
of_platform_depopulate(&adev->dev);
|
||||||
|
|
||||||
if (q6asm->pdev_dais)
|
|
||||||
of_platform_device_destroy(&q6asm->pdev_dais->dev, NULL);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue