Re: [PATCH 2/2] regulator: hi655x: Bump parent pmic module use count

2017-03-22 Thread Mark Brown
On Tue, Mar 21, 2017 at 03:23:50PM -0500, Jeremy Linton wrote: > I don't understand why it was done this way, and I'm not sure that > this driver shouldn't be triggered based on 'hi655x-regulator' device > (which is being registered by the hi655x-pmic/mfd driver). The only > thing I know for sure,

Re: [PATCH 2/2] regulator: hi655x: Bump parent pmic module use count

2017-03-21 Thread Jeremy Linton
Hi, On Tue, Mar 21, 2017 at 6:08 AM, Mark Brown wrote: > On Mon, Mar 20, 2017 at 11:53:41PM -0500, Jeremy Linton wrote: > >> + if (!try_module_get(parent->driver->owner)) { >> + dev_err(&pdev->dev, "unable to get parent module\n"); >> + return -ENODEV; >> + } >> +

Re: [PATCH 2/2] regulator: hi655x: Bump parent pmic module use count

2017-03-21 Thread Mark Brown
On Mon, Mar 20, 2017 at 11:53:41PM -0500, Jeremy Linton wrote: > + if (!try_module_get(parent->driver->owner)) { > + dev_err(&pdev->dev, "unable to get parent module\n"); > + return -ENODEV; > + } > + If this makes sense it should be being done in the driver core,

[PATCH 2/2] regulator: hi655x: Bump parent pmic module use count

2017-03-20 Thread Jeremy Linton
The hi655x-regulator driver depends on the parent pmic/mfc device driver but doesn't increase its use count. This results in system crashes if the parent module is unloaded while the regulators are still in use. Add explicit module get/put calls to keep the parent from being unloaded. Signed-off-b