Thread (8 messages) 8 messages, 3 authors, 2018-05-25

Re: [PATCH 8/9] regulator: bd71837: BD71837 PMIC regulator driver

From: Matti Vaittinen <mazziesaccount@gmail.com>
Date: 2018-05-25 11:32:47
Also in: linux-clk, lkml

On Fri, May 25, 2018 at 11:14:23AM +0100, Mark Brown wrote:
On Fri, May 25, 2018 at 10:22:53AM +0300, Matti Vaittinen wrote:
quoted
On Thu, May 24, 2018 at 05:51:27PM +0000, Vaittinen, Matti wrote:
quoted
quoted
quoted
devm_regulator_regster()
quoted
quoted
Makes sense. Thanks
quoted
I was going to do 
quoted
-       pmic = kzalloc(sizeof(struct bd71837_pmic), GFP_KERNEL);
+       pmic = devm_kzalloc(&pdev->dev, sizeof(struct bd71837_pmic),
+                           GFP_KERNEL);
quoted
and
quoted
-               rdev = regulator_register(desc, &config);
+               rdev = devm_regulator_register(&pdev->dev, desc, &config);

but is there now a race regarding freeing the pmic structure and
unregistering the regulator?
Why?  devm_ stuff gets unwound in the opposite order to the order in
which it was allocated.
Allright. Then there's no problems. I'll do the change.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help