mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Philippe Schenker <dev@pschenker.ch>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	Philippe Schenker <philippe.schenker@toradex.com>
Subject: Re: [RFC PATCH 1/2] Regulator: Core: Add clock-enable to fixed-regulator
Date: Tue, 30 Jul 2019 19:10:38 +0100	[thread overview]
Message-ID: <20190730181038.GK4264@sirena.org.uk> (raw)
In-Reply-To: <20190730173006.15823-2-dev@pschenker.ch>

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

On Tue, Jul 30, 2019 at 07:30:04PM +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
> 
> This adds the possibility to enable a fixed-regulator with a clock.

Why?  What does the hardware which makes this make sense look like?
Your cover letter didn't explain at all clearly, it just said that
there's a circuit that is connected to a clock which somehow switches
something but it's not clear.  It's certainly not clear that this should
be in the core, the circuit doesn't sound like a good idea at all.

> Signed-off-by: <philippe.schenker@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

This needs a cleanup.

>  
>  	/* cares about last_off_jiffy only if off_on_delay is required by
> @@ -2796,6 +2805,9 @@ static int _regulator_is_enabled(struct regulator_dev *rdev)
>  	if (rdev->ena_pin)
>  		return rdev->ena_gpio_state;
>  
> +	if (rdev->ena_clk)
> +		return (rdev->ena_clk_state > 0) ? 1 : 0;
> +

Please write normal conditional statements, this isn't helping
legibility.  Though in this case the ternery operator is totally
redundant anyway...

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

  reply	other threads:[~2019-07-30 18:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 17:30 [RFC PATCH 0/2] Hello Philippe Schenker
2019-07-30 17:30 ` [RFC PATCH 1/2] Regulator: Core: Add clock-enable to fixed-regulator Philippe Schenker
2019-07-30 18:10   ` Mark Brown [this message]
2019-07-30 21:00     ` Philippe Schenker
2019-07-31 21:23       ` Mark Brown
2019-08-05 11:07         ` Philippe Schenker
2019-08-05 16:37           ` Mark Brown
2019-08-06 12:57             ` Philippe Schenker
2019-08-06 18:26               ` Mark Brown
2019-08-07  6:46                 ` Philippe Schenker
2019-07-30 17:30 ` [RFC PATCH 2/2] ARM: dts: imx6ull: Add phy-supply to fec Philippe Schenker

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=20190730181038.GK4264@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=dev@pschenker.ch \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.schenker@toradex.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

all inboxes | Powered by JetHome®