lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Apr 2019 11:25:29 +0000
From:   Eric Hyeung Dong Jeong <eric.jeong.opensource@...semi.com>
To:     Mark Brown <broonie@...nel.org>,
        Eric Hyeung Dong Jeong <eric.jeong.opensource@...semi.com>
CC:     Liam Girdwood <lgirdwood@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        DEVICETREE <devicetree@...r.kernel.org>,
        LINUX-KERNEL <linux-kernel@...r.kernel.org>,
        Mark Rutland <mark.rutland@....com>,
        Support Opensource <Support.Opensource@...semi.com>
Subject: RE: [PATCH V1 3/3] regulator: slg51000: add slg51000 regulator driver

On Wednesday, April 17, 2019 12:25 AM +0900, Mark Brown wrote:
 
> 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().

I thought that it needs to return current status of a regulator when the function is called.
I am wondering that the *is_enabled()* function is just to check 
If a regulator has been turned on or not rather than getting current status of the regulator.

Thanks
Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ