lkml.org 
[lkml]   [2018]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/9] regulator: bd71837: BD71837 PMIC regulator driver
On Fri, May 25, 2018 at 10:22:53AM +0300, Matti Vaittinen wrote:
> On Thu, May 24, 2018 at 05:51:27PM +0000, Vaittinen, Matti wrote:

> > > devm_regulator_regster()

> > Makes sense. Thanks

> I was going to do

> - pmic = kzalloc(sizeof(struct bd71837_pmic), GFP_KERNEL);
> + pmic = devm_kzalloc(&pdev->dev, sizeof(struct bd71837_pmic),
> + GFP_KERNEL);

> and

> - 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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-05-25 12:15    [W:0.073 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site