From: Mark Brown <broonie@kernel.org>
To: Tzung-Bi Shih <tzungbi@google.com>
Cc: alsa-devel@alsa-project.org, Dylan Reid <dgreid@google.com>,
tiwai@suse.com, Jimmy Cheng-Yi Chiang <cychiang@google.com>
Subject: Re: [PATCH] ASoC: max98357a: release GPIO when component removing
Date: Wed, 8 May 2019 18:48:36 +0900 [thread overview]
Message-ID: <20190508094836.GL14916@sirena.org.uk> (raw)
In-Reply-To: <CA+Px+wWQpvE5H=vM+0u_c3xpuZ8ivfgy0_xB84Ty_dvMAqBSVg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 771 bytes --]
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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2019-05-08 9:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-07 5:11 [PATCH] ASoC: max98357a: release GPIO when component removing Tzung-Bi Shih
2019-05-08 6:33 ` Mark Brown
2019-05-08 9:27 ` Tzung-Bi Shih
2019-05-08 9:48 ` Mark Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190508094836.GL14916@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=cychiang@google.com \
--cc=dgreid@google.com \
--cc=tiwai@suse.com \
--cc=tzungbi@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox