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

Commit 1d7ea992 authored by Azhar Shaikh's avatar Azhar Shaikh
Browse files

PM: Fix a bug in dpm_suspend_late()



If there is any error while executing "late suspend" callbacks, then
the pm_runtime_enable() will not be called.
Hence in case of an error call pm_runtime_enable() before exiting from
dpm_suspend_late().

CRs-fixed: 740511
Change-Id: Iedacbbf47a4ef0ab0a0ace71fc809d056d56f89f
Signed-off-by: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent 04e700e7
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1000,6 +1000,7 @@ static int device_suspend_late(struct device *dev, pm_message_t state)
{
	pm_callback_t callback = NULL;
	char *info = NULL;
	int error = 0;

	__pm_runtime_disable(dev, false);

@@ -1025,7 +1026,15 @@ static int device_suspend_late(struct device *dev, pm_message_t state)
		callback = pm_late_early_op(dev->driver->pm, state);
	}

	return dpm_run_callback(callback, dev, state, info);
	error = dpm_run_callback(callback, dev, state, info);
	if (error)
		/*
		 * dpm_resume_early wouldn't be run for this failed device,
		 * hence enable runtime_pm now
		 */
		pm_runtime_enable(dev);

	return error;
}

/**