mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Maciej Purski <m.purski@samsung.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [RFC PATCH v2 3/3] regulator: core: Balance coupled regulators voltages
Date: Wed, 29 Nov 2017 18:29:45 +0000	[thread overview]
Message-ID: <20171129182945.t52kuz6ezogsdvej@sirena.org.uk> (raw)
In-Reply-To: <1508330822-8039-4-git-send-email-m.purski@samsung.com>

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

On Wed, Oct 18, 2017 at 02:47:02PM +0200, Maciej Purski wrote:

> +static void regulator_lock_supply_parents(struct regulator_dev *rdev)
> +{
> +	struct regulator_dev *supply = rdev_get_supply(rdev);
> +
> +	if (supply)
> +		regulator_lock_supply(supply);
> +}

These functions are fairly pointless as they're so small, and they're
misnamed as they only lock a single parent but the name suggests it's
going to lock multiple things (I'd expect all the coupled regulators or
something from the name).

> +	/*
> +	 * If the regulator is coupled with other regulators, we have to
> +	 * balance their voltages to keep the max_spread constraint.
> +	 */
> +	if (rdev->coupled_desc)
> +		regulator_balance_coupled(rdev->coupled_desc);

Just put the check into regulator_balance_coupled() rather than doing it
at every call site.

> +	/*
> +	 * If the regulator is coupled, return after changing consumer demands
> +	 * without changing voltage. This will be handled outside the function
> +	 * by regulator_balance_coupled()
> +	 */
> +	if (rdev->coupled_desc)
> +		goto out;
> +
> +	ret = regulator_set_voltage_rdev(regulator->rdev, min_uV, max_uV);
> +	if (ret < 0)
> +		goto out2;

Where is the elsewhere?  I'm worried this is going to make things more
confusing.

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

      reply	other threads:[~2017-11-29 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171018124722eucas1p23aa3280d33bfd38650783ac7f52b9909@eucas1p2.samsung.com>
2017-10-18 12:46 ` [RFC PATCH v2 0/3] Add coupled regulators mechanism Maciej Purski
     [not found]   ` <CGME20171018124727eucas1p255ccce41852d5585640f2d97153d2fa8@eucas1p2.samsung.com>
2017-10-18 12:47     ` [RFC PATCH v2 1/3] regulator: bindings: Add properties for coupled regulators Maciej Purski
2017-10-24 18:58       ` Rob Herring
2017-10-25  7:31         ` Maciej Purski
2017-10-25 12:59           ` Rob Herring
2017-10-25 13:10             ` Maciej Purski
     [not found]   ` <CGME20171018124735eucas1p2dc60191fb185f18dee16d4b3de8502cf@eucas1p2.samsung.com>
2017-10-18 12:47     ` [RFC PATCH v2 2/3] regulator: core: Parse coupled regulators properties Maciej Purski
2017-11-29 16:25       ` Mark Brown
     [not found]   ` <CGME20171018124737eucas1p2ed8002fa4910545e9d56a536303ffc12@eucas1p2.samsung.com>
2017-10-18 12:47     ` [RFC PATCH v2 3/3] regulator: core: Balance coupled regulators voltages Maciej Purski
2017-11-29 18:29       ` 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=20171129182945.t52kuz6ezogsdvej@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.purski@samsung.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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®