Commit ac6928f8 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

usb: dwc3: qcom: clean up suspend callbacks



Clean up the suspend callbacks by separating the error and success paths
to improve readability.

Also drop a related redundant initialisation.

Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220804151001.23612-10-johan+linaro@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3fafbd8
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -959,14 +959,15 @@ static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev)
{
	struct dwc3_qcom *qcom = dev_get_drvdata(dev);
	bool wakeup = device_may_wakeup(dev);
	int ret = 0;

	int ret;

	ret = dwc3_qcom_suspend(qcom, wakeup);
	if (!ret)
	if (ret)
		return ret;

	qcom->pm_suspended = true;

	return ret;
	return 0;
}

static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev)
@@ -976,10 +977,12 @@ static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev)
	int ret;

	ret = dwc3_qcom_resume(qcom, wakeup);
	if (!ret)
	if (ret)
		return ret;

	qcom->pm_suspended = false;

	return ret;
	return 0;
}

static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev)