diff options
author | Mark Brown <broonie@kernel.org> | 2017-11-10 21:30:48 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-10 21:30:48 +0000 |
commit | 73e13d0f6c1b3d69f0379500ba6d17d8a43a50c6 (patch) | |
tree | 35b4cfbc17bb3b9c0d3a4382ec8f7325ba077a24 /sound | |
parent | 4d0210e6d0aec4b95c762e2af1afa688cc512547 (diff) | |
parent | e0dac41b8c21d41534b04d520c1927c2b0ac9b5e (diff) |
Merge remote-tracking branch 'asoc/topic/component' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-core.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index fee4b0ef5566..3a1c3b44de5e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3371,20 +3371,14 @@ static void snd_soc_component_del_unlocked(struct snd_soc_component *component) list_del(&component->list); } -int snd_soc_register_component(struct device *dev, - const struct snd_soc_component_driver *component_driver, - struct snd_soc_dai_driver *dai_drv, - int num_dai) +int snd_soc_add_component(struct device *dev, + struct snd_soc_component *component, + const struct snd_soc_component_driver *component_driver, + struct snd_soc_dai_driver *dai_drv, + int num_dai) { - struct snd_soc_component *component; int ret; - component = kzalloc(sizeof(*component), GFP_KERNEL); - if (!component) { - dev_err(dev, "ASoC: Failed to allocate memory\n"); - return -ENOMEM; - } - ret = snd_soc_component_initialize(component, component_driver, dev); if (ret) goto err_free; @@ -3408,6 +3402,24 @@ err_free: kfree(component); return ret; } +EXPORT_SYMBOL_GPL(snd_soc_add_component); + +int snd_soc_register_component(struct device *dev, + const struct snd_soc_component_driver *component_driver, + struct snd_soc_dai_driver *dai_drv, + int num_dai) +{ + struct snd_soc_component *component; + + component = kzalloc(sizeof(*component), GFP_KERNEL); + if (!component) { + dev_err(dev, "ASoC: Failed to allocate memory\n"); + return -ENOMEM; + } + + return snd_soc_add_component(dev, component, component_driver, + dai_drv, num_dai); +} EXPORT_SYMBOL_GPL(snd_soc_register_component); /** |