alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: linux-kernel@vger.kernel.org, ryans.lee@maximintegrated.com,
	alsa-devel@alsa-project.org, dgreid@chromium.org
Subject: Re: [PATCH 2/2] ASoC: max98927: Add reset-gpio support
Date: Thu, 20 Sep 2018 09:19:05 -0700	[thread overview]
Message-ID: <20180920161905.GM2471@sirena.org.uk> (raw)
In-Reply-To: <20180912121955.33048-2-cychiang@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]

On Wed, Sep 12, 2018 at 08:19:55PM +0800, Cheng-Yi Chiang wrote:

> +	/*
> +	 * Release reset GPIO because we are not going to use it.
> +	 */
> +	devm_gpiod_put(dev, max98927->reset_gpio);

There is no need to do this, it's still potentially useful information
for userspace and it's also going to surprise anyone who tries to modify
the code to use this function at some other time (eg, when coming out of
suspend sometimes it's useful to reset the device).

> @@ -934,6 +1010,8 @@ static int max98927_i2c_probe(struct i2c_client *i2c,
>  	if (ret < 0)
>  		dev_err(&i2c->dev, "Failed to register component: %d\n", ret);
>  
> +	list_add(&max98927->list, &reset_list);
> +

I'm not seeing any locking of this list.  This also feels like something
that shouldn't be in this driver but should be pushed up a level - it's
only going to do the right thing if the reset line is only shared with
other devices using this driver, if someone does something like put the
CODEC and an external speaker amp on the same reset pin then it won't
work.  I'm not sure where the best place to do that is; drivers/reset
isn't really for this use case but feels right perhaps?

Can you perhaps split the basic reset handling out from this list
handling as a separate patch?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2018-09-20 16:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 12:19 [PATCH 1/2] ASoC: max9892x: Add documentation for reset-gpio support Cheng-Yi Chiang
2018-09-12 12:19 ` [PATCH 2/2] ASoC: max98927: Add " Cheng-Yi Chiang
2018-09-12 16:47   ` [alsa-devel] " Rohit Kumar
2018-09-17  9:00     ` Cheng-yi Chiang
2018-09-17 17:47       ` Mark Brown
2018-09-20 11:36   ` [alsa-devel] " kbuild test robot
2018-09-20 16:19   ` Mark Brown [this message]
2018-10-09 13:46     ` Cheng-yi Chiang
2018-10-12 10:05       ` Philipp Zabel
2018-10-12 13:46         ` Maxime Ripard
2018-10-17 17:02           ` Philipp Zabel
2018-11-20  1:19             ` Cheng-yi Chiang
2018-09-12 12:28 ` [PATCH 1/2] ASoC: max9892x: Add documentation for " Mark Brown
2018-09-13  4:25   ` Cheng-yi Chiang

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=20180920161905.GM2471@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=cychiang@chromium.org \
    --cc=dgreid@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ryans.lee@maximintegrated.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;
as well as URLs for NNTP newsgroup(s).