summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorAnand Moon <linux.amoon@gmail.com>2024-04-12 19:52:54 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-18 16:48:23 +0200
commit684e9f5f97eb4b7831298ffad140d5c1d426ff27 (patch)
treead63a8fb682708d2a51006e16b09443f181214ec /drivers/usb/dwc3
parenta6a243b6ed3c53dbe2a4eadae098c3c532b98b6b (diff)
usb: dwc3: exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to care about when the functions are actually used. Also make use of pm_sleep_ptr() to discard all PM_SLEEP related stuff if CONFIG_PM_SLEEP isn't enabled. Signed-off-by: Anand Moon <linux.amoon@gmail.com> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20240412142317.5191-6-linux.amoon@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/dwc3-exynos.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 5d365ca51771..3427522a7c6a 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -187,7 +187,6 @@ static const struct of_device_id exynos_dwc3_match[] = {
};
MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
-#ifdef CONFIG_PM_SLEEP
static int dwc3_exynos_suspend(struct device *dev)
{
struct dwc3_exynos *exynos = dev_get_drvdata(dev);
@@ -230,14 +229,8 @@ static int dwc3_exynos_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume)
-};
-
-#define DEV_PM_OPS (&dwc3_exynos_dev_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
+static DEFINE_SIMPLE_DEV_PM_OPS(dwc3_exynos_dev_pm_ops,
+ dwc3_exynos_suspend, dwc3_exynos_resume);
static struct platform_driver dwc3_exynos_driver = {
.probe = dwc3_exynos_probe,
@@ -245,7 +238,7 @@ static struct platform_driver dwc3_exynos_driver = {
.driver = {
.name = "exynos-dwc3",
.of_match_table = exynos_dwc3_match,
- .pm = DEV_PM_OPS,
+ .pm = pm_sleep_ptr(&dwc3_exynos_dev_pm_ops),
},
};