Re: [PATCH 2/2] ASoC: soc-core: add snd_soc_add_component()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Minor comment inline

On Thu, Sep 28, 2017 at 2:59 AM, Kuninori Morimoto
<kuninori.morimoto.gx@xxxxxxxxxxx> wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
>
> 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.

> +       }
> +
> +       return snd_soc_add_component(dev, component, component_driver,
> +                                    dai_drv, num_dai);
> +}
>  EXPORT_SYMBOL_GPL(snd_soc_register_component);


thanks,
Daniel.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux