[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180525072253.GC16888@localhost.localdomain>
Date: Fri, 25 May 2018 10:22:53 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>,
Mark Brown <broonie@...nel.org>
Cc: "mturquette@...libre.com" <mturquette@...libre.com>,
"sboyd@...nel.org" <sboyd@...nel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"lee.jones@...aro.org" <lee.jones@...aro.org>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"mazziesaccount@...il.com" <mazziesaccount@...il.com>,
"linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Mutanen, Mikko" <Mikko.Mutanen@...rohmeurope.com>,
"Haikola, Heikki" <Heikki.Haikola@...rohmeurope.com>
Subject: Re: [PATCH 8/9] regulator: bd71837: BD71837 PMIC regulator driver
On Thu, May 24, 2018 at 05:51:27PM +0000, Vaittinen, Matti wrote:
>
> From: Mark Brown [broonie@...nel.org]
> > Sent: Thursday, May 24, 2018 5:14 PM
> > On Thu, May 24, 2018 at 09:00:36AM +0300, Matti Vaittinen wrote:
> > > + rdev = regulator_register(desc, &config);
> > > + if (IS_ERR(rdev)) {
> >
> > 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?
Best Regards
Matti Vaittinen
Powered by blists - more mailing lists