lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]
\
 
 \ /
  Last update: 2020-01-22 14:12    [W:0.048 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site