Messages in this thread | | | Date | Wed, 22 Jan 2020 13:11:49 +0000 | From | Mark Brown <> | Subject | Re: [PATCH RESEND 1/2] regulator: arizona-ldo1: Improve handling of regulator unbinding |
| |
On Wed, Jan 22, 2020 at 11:08:41AM +0000, Charles Keepax wrote:
> The current unbinding process for Madera has some issues. The trouble > is runtime PM is disabled as the first step of the process, but
Why not just leave runtime PM active until all the subdevices are gone? This is a really bad hack and it's going to be fragile.
> +static int madera_ldo1_remove(struct platform_device *pdev) > +{ > + struct madera *madera = dev_get_drvdata(pdev->dev.parent); > + > + if (madera->internal_dcvdd) { > + regulator_disable(madera->dcvdd); > + regulator_put(madera->dcvdd); > + }
This is going to break bisection since it will result in double disables, it'd be fine to do the MFD change first since that'd just leak a reference to enable on a regulator which is about to be discarded entirely anyway but this reordering (and whatever other changes you've done since v1) means you add a double free. [unhandled content-type:application/pgp-signature] | |