linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Eric Jeong <eric.jeong.opensource@diasemi.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	DEVICETREE <devicetree@vger.kernel.org>,
	LINUX-KERNEL <linux-kernel@vger.kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Support Opensource <support.opensource@diasemi.com>
Subject: Re: [PATCH V1 3/3] regulator: slg51000: add slg51000 regulator driver
Date: Tue, 16 Apr 2019 16:24:48 +0100	[thread overview]
Message-ID: <20190416152448.GC4834@sirena.org.uk> (raw)
In-Reply-To: <5e4a6a007e45feac6d35203305cafd865be48755.1555389447.git.eric.jeong.opensource@diasemi.com>

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

On Tue, Apr 16, 2019 at 01:37:27PM +0900, Eric Jeong wrote:

> +static int slg51000_regulator_is_enabled(struct regulator_dev *rdev)
> +{
> +	struct slg51000 *chip = rdev_get_drvdata(rdev);
> +	int ret, id = rdev_get_id(rdev);
> +	unsigned int state;
> +
> +	ret = regmap_read(chip->regmap, es_reg[id].sreg, &state);
> +	if (ret < 0) {
> +		dev_err(chip->dev, "Failed to read status register(%d)\n",
> +			ret);
> +		return ret;
> +	}
> +
> +	if (!(state & SLG51000_STA_ILIM_FLAG_MASK) &&
> +	    (state & SLG51000_STA_VOUT_OK_FLAG_MASK))
> +		return 1;
> +	else
> +		return 0;

This looks like it should be a get_status() operation as it's reading
status bits rather than the command we sent to the device - for that
just use regulator_is_enabled_regmap().  

Otherwise this all looks great.

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

  reply	other threads:[~2019-04-16 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  4:37 [PATCH V1 0/3] slg51000: regulator driver submission Eric Jeong
2019-04-16  4:37 ` [PATCH V1 1/3] MAINTAINERS: slg51000 updates to the Dialog Semiconductor search terms Eric Jeong
2019-04-16  4:37 ` [PATCH V1 2/3] Documentation: devicetree: regulator: add binding for slg51000 Eric Jeong
2019-04-16 15:25   ` Mark Brown
2019-04-16  4:37 ` [PATCH V1 3/3] regulator: slg51000: add slg51000 regulator driver Eric Jeong
2019-04-16 15:24   ` Mark Brown [this message]
2019-04-17 11:25     ` Eric Hyeung Dong Jeong
2019-04-17 15:49       ` Mark Brown

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=20190416152448.GC4834@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eric.jeong.opensource@diasemi.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=support.opensource@diasemi.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).