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

Claudiu Beznea claudiu.beznea at microchip.com
Tue Jul 26 02:59:48 PDT 2022


Remove #ifdef CONFIG_PM_SLEEP and use DEFINE_SIMPLE_DEV_PM_OPS() along with
pm_sleep_ptr().

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

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,
 	},
 };
-- 
2.34.1




More information about the linux-arm-kernel mailing list