Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf4eaa44 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "regulator: core: avoid deadlock in QTI addition to regulator_unregister()"

parents 10cbadfc 29c128cf
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -5045,9 +5045,8 @@ DEFINE_DEBUGFS_ATTRIBUTE(reg_set_load_fops, reg_debug_mode_get,
static void rdev_free_qti_debugfs(struct regulator_dev *rdev)
static void rdev_free_qti_debugfs(struct regulator_dev *rdev)
{
{
	if (!IS_ERR_OR_NULL(rdev)) {
	if (!IS_ERR_OR_NULL(rdev)) {
		if (rdev->debug_consumer)
			rdev->debug_consumer->debugfs = NULL;
		regulator_put(rdev->debug_consumer);
		regulator_put(rdev->debug_consumer);
		rdev->debug_consumer = NULL;
	}
	}
}
}


@@ -5658,11 +5657,11 @@ void regulator_unregister(struct regulator_dev *rdev)
	}
	}


	flush_work(&rdev->disable_work.work);
	flush_work(&rdev->disable_work.work);
	rdev_free_qti_debugfs(rdev);


	mutex_lock(&regulator_list_mutex);
	mutex_lock(&regulator_list_mutex);


	debugfs_remove_recursive(rdev->debugfs);
	debugfs_remove_recursive(rdev->debugfs);
	rdev_free_qti_debugfs(rdev);
	WARN_ON(rdev->open_count);
	WARN_ON(rdev->open_count);
	regulator_remove_coupling(rdev);
	regulator_remove_coupling(rdev);
	unset_regulator_supplies(rdev);
	unset_regulator_supplies(rdev);