Skip to content

Commit

Permalink
Merge branch 'topic/component' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/broonie/sound into asoc-core
  • Loading branch information
Mark Brown committed Oct 10, 2017
2 parents 7dd5d0d + e0dac41 commit d734627
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
5 changes: 5 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ int snd_soc_register_codec(struct device *dev,
const struct snd_soc_codec_driver *codec_drv,
struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_codec(struct device *dev);
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);
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);
Expand Down
34 changes: 23 additions & 11 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3404,20 +3404,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;
Expand All @@ -3441,6 +3435,24 @@ int snd_soc_register_component(struct device *dev,
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);

/**
Expand Down

0 comments on commit d734627

Please sign in to comment.