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

From: Claudiu Beznea
Date: Tue Jul 26 2022 - 05:58:12 EST


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

Signed-off-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>
---
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