[alsa-devel] [PATCH] ASoC: max98357a: release GPIO when component removing

Mark Brown broonie at kernel.org
Wed May 8 11:48:36 CEST 2019


On Wed, May 08, 2019 at 05:27:35PM +0800, Tzung-Bi Shih wrote:

> probe().  What do we expect to do in component's probe()?

Only things that really, really need the card.

> As component's probe() is later than device's, I thought we tend to
> put resource allocation in component's probe() for reasons:
> - to speed up the booting *maybe* a little
> - to allocate resources when really need them

No, this is backwards - there's no point in running through the ASoC
level initialization only to find out we don't have some critical
resource.

> I am using devm_gpiod_put() instead of gpiod_put() so that I suppose
> devm_ should take care of the rest of cleanup.  Do you think this is
> still a mess?

The entire point of devm_ is that it does all the cleanup for you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20190508/5a863835/attachment.sig>


More information about the Alsa-devel mailing list