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

Commit 10f238bc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu/arm-smmu: Reorganize code to allow no gdsc"

parents 5a0131f0 b003b955
Loading
Loading
Loading
Loading
+18 −17
Original line number Diff line number Diff line
@@ -744,11 +744,10 @@ static int arm_smmu_unrequest_bus(struct arm_smmu_device *smmu)

static int arm_smmu_disable_regulators(struct arm_smmu_device *smmu)
{
	if (!smmu->gdsc)
		return 0;

	arm_smmu_unprepare_clocks(smmu);
	arm_smmu_unrequest_bus(smmu);
	if (!smmu->gdsc)
		return 0;
	return regulator_disable(smmu->gdsc);
}

@@ -756,25 +755,27 @@ static int arm_smmu_enable_regulators(struct arm_smmu_device *smmu)
{
	int ret;

	if (!smmu->gdsc)
		return 0;

	if (smmu->gdsc) {
		ret = regulator_enable(smmu->gdsc);
		if (ret)
		return ret;

	ret = arm_smmu_request_bus(smmu);
	if (ret) {
		regulator_disable(smmu->gdsc);
			goto out;
	}

	ret = arm_smmu_request_bus(smmu);
	if (ret)
		goto out_reg;

	ret = arm_smmu_prepare_clocks(smmu);
	if (ret) {
	if (ret)
		goto out_bus;

	return ret;

out_bus:
	arm_smmu_unrequest_bus(smmu);
out_reg:
	if (smmu->gdsc)
		regulator_disable(smmu->gdsc);
	}

out:
	return ret;
}