Re: [PATCH] ASoC: max98357a: release GPIO when component removing

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

 



On Tue, May 07, 2019 at 01:11:40PM +0800, Tzung-Bi Shih wrote:

> +static void max98357a_component_remove(struct snd_soc_component *component)
> +{
> +	struct max98357a_priv *max98357a =
> +			snd_soc_component_get_drvdata(component);
> +
> +	if (max98357a->sdmode)
> +		devm_gpiod_put(component->dev, max98357a->sdmode);
> +}

This is an obvious mess, if you're explicitly freeing devm_ allocated
resources in the common case something is going wrong.  Just move the
initial allocation to the device level probe so devm can do what it's
supposed to.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[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