[PATCH v4 1/2] ASoC: mediatek: mt6359: add codec driver

Tzung-Bi Shih tzungbi at google.com
Mon Aug 17 01:21:53 EDT 2020


On Sun, Aug 16, 2020 at 1:20 AM Jiaxin Yu <jiaxin.yu at mediatek.com> wrote:
>
> +static int mt6359_platform_driver_probe(struct platform_device *pdev)
[snip]
> +
> +       return devm_snd_soc_register_component(&pdev->dev,
> +                                              &mt6359_soc_component_driver,
> +                                              mt6359_dai_driver,
> +                                              ARRAY_SIZE(mt6359_dai_driver));
> +}
> +
> +static int mt6359_platform_driver_remove(struct platform_device *pdev)
> +{
> +       struct mt6359_priv *priv = dev_get_drvdata(&pdev->dev);
> +       int ret;
> +
> +       dev_dbg(&pdev->dev, "%s(), dev name %s\n",
> +               __func__, dev_name(&pdev->dev));
> +
> +       ret = regulator_disable(priv->avdd_reg);
> +       if (ret) {
> +               dev_err(&pdev->dev, "%s(), failed to disable regulator!\n",
> +                       __func__);
> +               return ret;
> +       }
> +
> +       snd_soc_unregister_component(&pdev->dev);

You don't need to unregister the component which is already delegated to devm.



More information about the linux-arm-kernel mailing list