struct arm_smmu_device *smmu = container_of(nb,
struct arm_smmu_device, regulator_nb);
+ /* Ignore EVENT DISABLE as no clocks could be turned on
+ * at this notification.
+ */
+ if (event != REGULATOR_EVENT_PRE_DISABLE &&
+ event != REGULATOR_EVENT_ENABLE)
+ return NOTIFY_OK;
+
ret = arm_smmu_prepare_clocks(smmu);
if (ret)
goto out;
if (ret)
goto unprepare_clock;
- if (event == REGULATOR_EVENT_DISABLE)
+ if (event == REGULATOR_EVENT_PRE_DISABLE)
arm_smmu_halt(smmu);
else if (event == REGULATOR_EVENT_ENABLE)
arm_smmu_resume(smmu);
unprepare_clock:
arm_smmu_unprepare_clocks(smmu);
out:
- return ret;
+ return NOTIFY_OK;
}
static int register_regulator_notifier(struct arm_smmu_device *smmu)