[alsa-devel] [PATCH 2/2] ASoC: soc-core: add snd_soc_add_component()
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Thu Sep 28 10:10:06 CEST 2017
Hi Daniel
> > From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> >
> > ALSA SoC platform/codec will be replaced to component soon.
> > But, some function exist in "platform" doesn't exist in "component".
> > Current soc-core has snd_soc_register_component(), but
> > doesn't have snd_soc_add_component() like snd_soc_add_platform().
> > This patch adds it.
<snip>
> > +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;
>
> No need to print an error message if kzalloc fails. The core will print it.
Thanks. Yes I had noticed this warning from checkpatch.
The main purpose of this patch is separate "register" function into
"register" and "add".
Thus, I keeped existing all code.
I think "remove unneeded message" should be increment patch,
but can you agree ?
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list