Re: [PATCH 3/6] ASoC: atmel: use devm_snd_soc_register_card()

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

 



Hi!

2024-01-10 at 02:28, Kuninori Morimoto wrote:
*snip*
> diff --git a/sound/soc/atmel/tse850-pcm5142.c b/sound/soc/atmel/tse850-pcm5142.c
> index 611da23325d3..f280ec597a08 100644
> --- a/sound/soc/atmel/tse850-pcm5142.c
> +++ b/sound/soc/atmel/tse850-pcm5142.c
> @@ -398,7 +398,7 @@ static int tse850_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = snd_soc_register_card(card);
> +	ret = devm_snd_soc_register_card(dev, card);
>  	if (ret) {
>  		dev_err(dev, "snd_soc_register_card failed\n");
>  		goto err_disable_ana;
> @@ -416,7 +416,6 @@ static void tse850_remove(struct platform_device *pdev)
>  	struct snd_soc_card *card = platform_get_drvdata(pdev);
>  	struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card);
>  
> -	snd_soc_unregister_card(card);
>  	regulator_disable(tse850->ana);

Along the lines of what Takashi hinted at, I'm not comfortable with
disabling the ana regulator early. If you want to proceed with these
changes, then please also change from

	tse850->ana = devm_regulator_get(dev, "axentia,ana");
	if (IS_ERR(tse850->ana)) {
		if (PTR_ERR(tse850->ana) != -EPROBE_DEFER)
			dev_err(dev, "failed to get 'ana' regulator\n");
		return PTR_ERR(tse850->ana);
	}

	ret = regulator_enable(tse850->ana);
	if (ret < 0) {
		dev_err(dev, "failed to enable the 'ana' regulator\n");
		return ret;
	}

to

	tse850->ana = devm_regulator_get_enable(dev, "axentia,ana");
	if (IS_ERR(tse850->ana)) {
		if (PTR_ERR(tse850->ana) != -EPROBE_DEFER)
			dev_err(dev, "failed to get 'ana' regulator\n");
		return PTR_ERR(tse850->ana);
	}

and zap the explicit regulator_disable() from tse850_remove(), which
of course makes tse850_remove() empty and removable too when combined
with the removal of snd_soc_unregister_card().

Cheers,
Peter

>  }
>  



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

  Powered by Linux