Commit 30b5b066 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: dwc: 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, so the corresponding
#ifdef can be dropped.

Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM
isn't enabled.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent d6b81be1
...@@ -71,7 +71,6 @@ static void dwc_pwm_remove(struct pci_dev *pci) ...@@ -71,7 +71,6 @@ static void dwc_pwm_remove(struct pci_dev *pci)
pm_runtime_get_noresume(&pci->dev); pm_runtime_get_noresume(&pci->dev);
} }
#ifdef CONFIG_PM_SLEEP
static int dwc_pwm_suspend(struct device *dev) static int dwc_pwm_suspend(struct device *dev)
{ {
struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
...@@ -106,9 +105,8 @@ static int dwc_pwm_resume(struct device *dev) ...@@ -106,9 +105,8 @@ static int dwc_pwm_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(dwc_pwm_pm_ops, dwc_pwm_suspend, dwc_pwm_resume); static DEFINE_SIMPLE_DEV_PM_OPS(dwc_pwm_pm_ops, dwc_pwm_suspend, dwc_pwm_resume);
static const struct pci_device_id dwc_pwm_id_table[] = { static const struct pci_device_id dwc_pwm_id_table[] = {
{ PCI_VDEVICE(INTEL, 0x4bb7) }, /* Elkhart Lake */ { PCI_VDEVICE(INTEL, 0x4bb7) }, /* Elkhart Lake */
...@@ -122,7 +120,7 @@ static struct pci_driver dwc_pwm_driver = { ...@@ -122,7 +120,7 @@ static struct pci_driver dwc_pwm_driver = {
.remove = dwc_pwm_remove, .remove = dwc_pwm_remove,
.id_table = dwc_pwm_id_table, .id_table = dwc_pwm_id_table,
.driver = { .driver = {
.pm = &dwc_pwm_pm_ops, .pm = pm_ptr(&dwc_pwm_pm_ops),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment