mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
ASoC: soc-component: add snd_soc_component_alloc()
struct snd_soc_component will be capsuled soon, then, we will can't alloc it. Adds snd_soc_component_alloc() to alloc it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/87v7a6rz80.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
23b64e9b9b
commit
de182d84b3
@@ -283,6 +283,7 @@ static inline int snd_soc_component_cache_sync(
|
||||
return regcache_sync(component->regmap);
|
||||
}
|
||||
|
||||
struct snd_soc_component *snd_soc_component_alloc(struct device *dev);
|
||||
void snd_soc_component_set_aux(struct snd_soc_component *component,
|
||||
struct snd_soc_aux_dev *aux);
|
||||
int snd_soc_component_init(struct snd_soc_component *component);
|
||||
|
||||
@@ -29,6 +29,19 @@ static inline int _soc_component_ret_reg_rw(struct snd_soc_component *component,
|
||||
func, component->name, reg);
|
||||
}
|
||||
|
||||
struct snd_soc_component *snd_soc_component_alloc(struct device *dev)
|
||||
{
|
||||
struct snd_soc_component *component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL);
|
||||
|
||||
if (!component)
|
||||
return NULL;
|
||||
|
||||
component->dev = dev;
|
||||
|
||||
return component;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_alloc);
|
||||
|
||||
/*
|
||||
* We might want to check substream by using list.
|
||||
* In such case, we can update these macros.
|
||||
|
||||
Reference in New Issue
Block a user