lkml.org 
[lkml]   [2018]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 00/10] Regulator ena_gpiod fixups
On Wed, Nov 28, 2018 at 4:22 PM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:

> It looks like the patches are assuming the regulator core,
> doesn't free the GPIO on an error, however that is not true in
> all cases. If only a single regulator has requested the GPIO then
> all the error paths after the call to regulator_ena_gpio_request
> in regulator_register will free the GPIO.

I guess part of it is that I should make sure not to gpiod_put()
if the [devm_]regulator_register() fails, I will go over the
series with that in mind!

Essentially the semantic is that the [devm_]regulator_register()
call will immediately take ownership of the descriptor
and place it in the regulator core.

I'll check!

> Although this is not the
> case if more than one regulator has requested the GPIO.

This should be fine since the regulator core refcounts it,
when all the other regulators drops it, gpiod_put() will be
called as the refcount goes down to 0.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2018-11-29 16:53    [W:0.948 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site