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

Commit 333cc04d authored by Jack Pham's avatar Jack Pham
Browse files

usb: dwc3-msm: Fix compile error when CONFIG_PM_* undefined



The SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros only
assign the PM functions if CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME,
respectively, are defined. Otherwise the compiler warns about
unreferenced functions. Wrap the function definitions with the
appropriate #ifdefs.

Change-Id: I79f3d3b8615de435d1f3bbcc2925ce6b67fb1239
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 678b8ed6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2692,6 +2692,7 @@ static int dwc3_msm_remove(struct platform_device *pdev)
	return 0;
}

#ifdef CONFIG_PM_SLEEP
static int dwc3_msm_pm_suspend(struct device *dev)
{
	int ret = 0;
@@ -2742,7 +2743,9 @@ static int dwc3_msm_pm_resume(struct device *dev)

	return ret;
}
#endif

#ifdef CONFIG_PM_RUNTIME
static int dwc3_msm_runtime_idle(struct device *dev)
{
	struct dwc3_msm *mdwc = dev_get_drvdata(dev);
@@ -2786,6 +2789,7 @@ static int dwc3_msm_runtime_resume(struct device *dev)

	return dwc3_msm_resume(mdwc);
}
#endif

static const struct dev_pm_ops dwc3_msm_dev_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(dwc3_msm_pm_suspend, dwc3_msm_pm_resume)