diff --git a/drivers/misc/cardreader/alcor_pci.c b/drivers/misc/cardreader/alcor_pci.c index 9e0f4f91763e..e76fd4b5d6cc 100644 --- a/drivers/misc/cardreader/alcor_pci.c +++ b/drivers/misc/cardreader/alcor_pci.c @@ -188,7 +188,6 @@ static void alcor_pci_remove(struct pci_dev *pdev) pci_set_drvdata(pdev, NULL); } -#ifdef CONFIG_PM_SLEEP static int alcor_suspend(struct device *dev) { return 0; @@ -203,9 +202,8 @@ static int alcor_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(alcor_pci_pm_ops, alcor_suspend, alcor_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(alcor_pci_pm_ops, alcor_suspend, alcor_resume); static struct pci_driver alcor_driver = { .name = DRV_NAME_ALCOR_PCI, @@ -213,7 +211,7 @@ static struct pci_driver alcor_driver = { .probe = alcor_pci_probe, .remove = alcor_pci_remove, .driver = { - .pm = &alcor_pci_pm_ops + .pm = pm_sleep_ptr(&alcor_pci_pm_ops) }, }; diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c index 8e0d11e59c4e..2ab6f6884766 100644 --- a/drivers/misc/cb710/core.c +++ b/drivers/misc/cb710/core.c @@ -166,7 +166,7 @@ void cb710_set_irq_handler(struct cb710_slot *slot, } EXPORT_SYMBOL_GPL(cb710_set_irq_handler); -static int __maybe_unused cb710_suspend(struct device *dev_d) +static int cb710_suspend(struct device *dev_d) { struct pci_dev *pdev = to_pci_dev(dev_d); struct cb710_chip *chip = pci_get_drvdata(pdev); @@ -175,7 +175,7 @@ static int __maybe_unused cb710_suspend(struct device *dev_d) return 0; } -static int __maybe_unused cb710_resume(struct device *dev_d) +static int cb710_resume(struct device *dev_d) { struct pci_dev *pdev = to_pci_dev(dev_d); struct cb710_chip *chip = pci_get_drvdata(pdev); @@ -296,14 +296,14 @@ static const struct pci_device_id cb710_pci_tbl[] = { { } }; -static SIMPLE_DEV_PM_OPS(cb710_pm_ops, cb710_suspend, cb710_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cb710_pm_ops, cb710_suspend, cb710_resume); static struct pci_driver cb710_driver = { .name = KBUILD_MODNAME, .id_table = cb710_pci_tbl, .probe = cb710_probe, .remove = cb710_remove_one, - .driver.pm = &cb710_pm_ops, + .driver.pm = pm_sleep_ptr(&cb710_pm_ops), }; static int __init cb710_init_module(void) diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c index c9b526a212d0..4e162905d0c0 100644 --- a/drivers/misc/isl29003.c +++ b/drivers/misc/isl29003.c @@ -416,7 +416,6 @@ static void isl29003_remove(struct i2c_client *client) kfree(i2c_get_clientdata(client)); } -#ifdef CONFIG_PM_SLEEP static int isl29003_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -441,12 +440,7 @@ static int isl29003_resume(struct device *dev) data->power_state_before_suspend); } -static SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume); -#define ISL29003_PM_OPS (&isl29003_pm_ops) - -#else -#define ISL29003_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume); static const struct i2c_device_id isl29003_id[] = { { .name = "isl29003" }, @@ -457,7 +451,7 @@ MODULE_DEVICE_TABLE(i2c, isl29003_id); static struct i2c_driver isl29003_driver = { .driver = { .name = ISL29003_DRV_NAME, - .pm = ISL29003_PM_OPS, + .pm = pm_sleep_ptr(&isl29003_pm_ops), }, .probe = isl29003_probe, .remove = isl29003_remove, diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index 5bf95176a00e..7ef073414673 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c @@ -105,7 +105,6 @@ static void lis302dl_spi_remove(struct spi_device *spi) lis3lv02d_remove_fs(&lis3_dev); } -#ifdef CONFIG_PM_SLEEP static int lis3lv02d_spi_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); @@ -127,15 +126,14 @@ static int lis3lv02d_spi_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(lis3lv02d_spi_pm, lis3lv02d_spi_suspend, +static DEFINE_SIMPLE_DEV_PM_OPS(lis3lv02d_spi_pm, lis3lv02d_spi_suspend, lis3lv02d_spi_resume); static struct spi_driver lis302dl_spi_driver = { .driver = { .name = DRV_NAME, - .pm = &lis3lv02d_spi_pm, + .pm = pm_sleep_ptr(&lis3lv02d_spi_pm), .of_match_table = of_match_ptr(lis302dl_spi_dt_ids), }, .probe = lis302dl_spi_probe, diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c index 15785597da40..5d3c5a298ba4 100644 --- a/drivers/misc/pch_phub.c +++ b/drivers/misc/pch_phub.c @@ -705,14 +705,14 @@ static void pch_phub_remove(struct pci_dev *pdev) kfree(chip); } -static int __maybe_unused pch_phub_suspend(struct device *dev_d) +static int pch_phub_suspend(struct device *dev_d) { device_wakeup_disable(dev_d); return 0; } -static int __maybe_unused pch_phub_resume(struct device *dev_d) +static int pch_phub_resume(struct device *dev_d) { device_wakeup_disable(dev_d); @@ -729,14 +729,14 @@ static const struct pci_device_id pch_phub_pcidev_id[] = { }; MODULE_DEVICE_TABLE(pci, pch_phub_pcidev_id); -static SIMPLE_DEV_PM_OPS(pch_phub_pm_ops, pch_phub_suspend, pch_phub_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pch_phub_pm_ops, pch_phub_suspend, pch_phub_resume); static struct pci_driver pch_phub_driver = { .name = "pch_phub", .id_table = pch_phub_pcidev_id, .probe = pch_phub_probe, .remove = pch_phub_remove, - .driver.pm = &pch_phub_pm_ops, + .driver.pm = pm_sleep_ptr(&pch_phub_pm_ops), }; module_pci_driver(pch_phub_driver); diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index 331cae539290..ed57de14b876 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c @@ -459,7 +459,7 @@ static void phantom_remove(struct pci_dev *pdev) pci_disable_device(pdev); } -static int __maybe_unused phantom_suspend(struct device *dev_d) +static int phantom_suspend(struct device *dev_d) { struct phantom_device *dev = dev_get_drvdata(dev_d); @@ -471,7 +471,7 @@ static int __maybe_unused phantom_suspend(struct device *dev_d) return 0; } -static int __maybe_unused phantom_resume(struct device *dev_d) +static int phantom_resume(struct device *dev_d) { struct phantom_device *dev = dev_get_drvdata(dev_d); @@ -488,14 +488,14 @@ static struct pci_device_id phantom_pci_tbl[] = { }; MODULE_DEVICE_TABLE(pci, phantom_pci_tbl); -static SIMPLE_DEV_PM_OPS(phantom_pm_ops, phantom_suspend, phantom_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(phantom_pm_ops, phantom_suspend, phantom_resume); static struct pci_driver phantom_pci_driver = { .name = "phantom", .id_table = phantom_pci_tbl, .probe = phantom_probe, .remove = phantom_remove, - .driver.pm = &phantom_pm_ops, + .driver.pm = pm_sleep_ptr(&phantom_pm_ops), }; static CLASS_ATTR_STRING(version, 0444, PHANTOM_VERSION); diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index 4677d5a30941..50e7dc502f16 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c @@ -207,7 +207,7 @@ static void tifm_7xx1_switch_media(struct work_struct *work) spin_unlock_irqrestore(&fm->lock, flags); } -static int __maybe_unused tifm_7xx1_suspend(struct device *dev_d) +static int tifm_7xx1_suspend(struct device *dev_d) { struct pci_dev *dev = to_pci_dev(dev_d); struct tifm_adapter *fm = pci_get_drvdata(dev); @@ -224,7 +224,7 @@ static int __maybe_unused tifm_7xx1_suspend(struct device *dev_d) return 0; } -static int __maybe_unused tifm_7xx1_resume(struct device *dev_d) +static int tifm_7xx1_resume(struct device *dev_d) { struct pci_dev *dev = to_pci_dev(dev_d); struct tifm_adapter *fm = pci_get_drvdata(dev); @@ -406,14 +406,14 @@ static const struct pci_device_id tifm_7xx1_pci_tbl[] = { { } }; -static SIMPLE_DEV_PM_OPS(tifm_7xx1_pm_ops, tifm_7xx1_suspend, tifm_7xx1_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(tifm_7xx1_pm_ops, tifm_7xx1_suspend, tifm_7xx1_resume); static struct pci_driver tifm_7xx1_driver = { .name = DRIVER_NAME, .id_table = tifm_7xx1_pci_tbl, .probe = tifm_7xx1_probe, .remove = tifm_7xx1_remove, - .driver.pm = &tifm_7xx1_pm_ops, + .driver.pm = pm_sleep_ptr(&tifm_7xx1_pm_ops), }; module_pci_driver(tifm_7xx1_driver); diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index c871ea860bb5..df6931ef267e 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/misc/tsl2550.c @@ -398,8 +398,6 @@ static void tsl2550_remove(struct i2c_client *client) kfree(i2c_get_clientdata(client)); } -#ifdef CONFIG_PM_SLEEP - static int tsl2550_suspend(struct device *dev) { return tsl2550_set_power_state(to_i2c_client(dev), 0); @@ -410,14 +408,7 @@ static int tsl2550_resume(struct device *dev) return tsl2550_set_power_state(to_i2c_client(dev), 1); } -static SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume); -#define TSL2550_PM_OPS (&tsl2550_pm_ops) - -#else - -#define TSL2550_PM_OPS NULL - -#endif /* CONFIG_PM_SLEEP */ +static DEFINE_SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume); static const struct i2c_device_id tsl2550_id[] = { { .name = "tsl2550" }, @@ -435,7 +426,7 @@ static struct i2c_driver tsl2550_driver = { .driver = { .name = TSL2550_DRV_NAME, .of_match_table = tsl2550_of_match, - .pm = TSL2550_PM_OPS, + .pm = pm_sleep_ptr(&tsl2550_pm_ops), }, .probe = tsl2550_probe, .remove = tsl2550_remove,