diff mbox series

[2/2] usb: gadget: udc: atmel: remove #ifdef CONFIG_PM_SLEEP

Message ID 20220726095948.1809038-2-claudiu.beznea@microchip.com (mailing list archive)
State New, archived
Headers show
Series [1/2] usb: gadget: at91_udc: stop using legacy pm ops | expand

Commit Message

Claudiu Beznea July 26, 2022, 9:59 a.m. UTC
Remove #ifdef CONFIG_PM_SLEEP and use DEFINE_SIMPLE_DEV_PM_OPS() along with
pm_sleep_ptr().

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index ae2bfbac603e..6c088f6e9afa 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2384,7 +2384,6 @@  static int usba_udc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int usba_udc_suspend(struct device *dev)
 {
 	struct usba_udc *udc = dev_get_drvdata(dev);
@@ -2442,15 +2441,14 @@  static int usba_udc_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume);
 
 static struct platform_driver udc_driver = {
 	.remove		= usba_udc_remove,
 	.driver		= {
 		.name		= "atmel_usba_udc",
-		.pm		= &usba_udc_pm_ops,
+		.pm		= pm_sleep_ptr(&usba_udc_pm_ops),
 		.of_match_table	= atmel_udc_dt_ids,
 	},
 };