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]
Message-ID: <CACRpkdYKAZLybzsLorEU5Cye89qVtvd0GQNoWcUXeSdC_WogtQ@mail.gmail.com>
Date:	Wed, 23 Apr 2014 10:38:33 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	Samuel Ortiz <sameo@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Silvio F <silvio.fricke@...il.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Shawn Guo <shawn.guo@...aro.org>,
	Viresh Kumar <viresh.linux@...il.com>,
	Shiraz Hashim <shiraz.hashim@...com>,
	spear-devel <spear-devel@...t.st.com>
Subject: Re: [PATCH 2/6] mfd: stmpe: add optional regulators

On Thu, Apr 17, 2014 at 12:30 PM, Lee Jones <lee.jones@...aro.org> wrote:

>> The STMPE has VCC and VIO supply lines, and sometimes (as on
>> Ux500) this comes from a software-controlled regulator. Make
>> it possible to supply the STMPE with power from these
>> regulators.
>>
>> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
(...)
>>  int stmpe_remove(struct stmpe *stmpe)
>>  {
>> +     if (!IS_ERR(stmpe->vio))
>> +             regulator_disable(stmpe->vio);
>> +     if (!IS_ERR(stmpe->vcc))
>> +             regulator_disable(stmpe->vcc);
>> +
>
> Genuine question:
>   Doesn't the regulator core take care of this for you on removal?

No devm_regulator_release() that gets called when refcount goes to 0
just calls regulator_put().

regulator_put(), in turn, will just kfree the struct regulator *.

Thus we need to balance enable/disable.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ