mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Raymond Hackley <raymondhackley@protonmail.com>,
	davem@davemloft.net, devicetree@vger.kernel.org,
	edumazet@google.com, jk@codeconstruct.com.au, kuba@kernel.org,
	lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
	michael@walle.cc, netdev@vger.kernel.org, pabeni@redhat.com,
	robh+dt@kernel.org, u.kleine-koenig@pengutronix.de
Subject: Re: [PATCH v2 2/2] NFC: nxp-nci: Add pad supply voltage pvdd-supply
Date: Fri, 9 Jun 2023 20:34:01 +0100	[thread overview]
Message-ID: <a3d2dd4f-38ce-40ca-9085-893f808f817b@sirena.org.uk> (raw)
In-Reply-To: <7ad5d027-9b15-f59e-aa76-17e498cb7aba@linaro.org>

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

On Fri, Jun 09, 2023 at 09:29:51PM +0200, Krzysztof Kozlowski wrote:
> On 09/06/2023 19:40, Raymond Hackley wrote:
> > On Friday, June 9th, 2023 at 3:46 PM, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> > Second condition regulator_is_enabled(pvdd) is to make sure that pvdd is
> > disabled with balance.

> So you have buggy code and to hide the bug you add checks? No, make the
> code correct so the check is not needed.

Specifically your driver should only ever call regulator_disable() to
balance out regulator_enable() calls it made itself and it should know
how many of those it has done.  regulator_is_enabled() should only ever
be used during probe if for some reason it is important to figure out if
the device is already powered for startup, this should be very unusual.
If something else enabled the regualtor then whatever did that needs to
undo those enables, not another driver.

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

  reply	other threads:[~2023-06-09 19:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 15:41 [PATCH v2 0/2] " Raymond Hackley
2023-06-09 15:42 ` [PATCH v2 1/2] dt-bindings: nfc: nxp-nci: document pvdd-supply Raymond Hackley
2023-06-09 15:42 ` [PATCH v2 2/2] NFC: nxp-nci: Add pad supply voltage pvdd-supply Raymond Hackley
2023-06-09 15:46   ` Krzysztof Kozlowski
2023-06-09 17:40     ` Raymond Hackley
2023-06-09 19:29       ` Krzysztof Kozlowski
2023-06-09 19:34         ` Mark Brown [this message]
2023-06-09 20:52           ` Raymond Hackley
2023-06-09 20:44         ` Raymond Hackley

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=a3d2dd4f-38ce-40ca-9085-893f808f817b@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=jk@codeconstruct.com.au \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raymondhackley@protonmail.com \
    --cc=robh+dt@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

all inboxes | Powered by JetHome®