wifi: mt76: mt7663s: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. The new macros allow suspend and resume functions to be automatically dropped without any #ifdef guards. Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
29e247ece5
commit
fb47c1547b
|
@ -181,7 +181,6 @@ static void mt7663s_remove(struct sdio_func *func)
|
||||||
mt76_free_device(&dev->mt76);
|
mt76_free_device(&dev->mt76);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int mt7663s_suspend(struct device *dev)
|
static int mt7663s_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct sdio_func *func = dev_to_sdio_func(dev);
|
struct sdio_func *func = dev_to_sdio_func(dev);
|
||||||
|
@ -236,28 +235,20 @@ static int mt7663s_resume(struct device *dev)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops mt7663s_pm_ops = {
|
|
||||||
.suspend = mt7663s_suspend,
|
|
||||||
.resume = mt7663s_resume,
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MODULE_DEVICE_TABLE(sdio, mt7663s_table);
|
MODULE_DEVICE_TABLE(sdio, mt7663s_table);
|
||||||
MODULE_FIRMWARE(MT7663_OFFLOAD_FIRMWARE_N9);
|
MODULE_FIRMWARE(MT7663_OFFLOAD_FIRMWARE_N9);
|
||||||
MODULE_FIRMWARE(MT7663_OFFLOAD_ROM_PATCH);
|
MODULE_FIRMWARE(MT7663_OFFLOAD_ROM_PATCH);
|
||||||
MODULE_FIRMWARE(MT7663_FIRMWARE_N9);
|
MODULE_FIRMWARE(MT7663_FIRMWARE_N9);
|
||||||
MODULE_FIRMWARE(MT7663_ROM_PATCH);
|
MODULE_FIRMWARE(MT7663_ROM_PATCH);
|
||||||
|
|
||||||
|
static DEFINE_SIMPLE_DEV_PM_OPS(mt7663s_pm_ops, mt7663s_suspend, mt7663s_resume);
|
||||||
|
|
||||||
static struct sdio_driver mt7663s_driver = {
|
static struct sdio_driver mt7663s_driver = {
|
||||||
.name = KBUILD_MODNAME,
|
.name = KBUILD_MODNAME,
|
||||||
.probe = mt7663s_probe,
|
.probe = mt7663s_probe,
|
||||||
.remove = mt7663s_remove,
|
.remove = mt7663s_remove,
|
||||||
.id_table = mt7663s_table,
|
.id_table = mt7663s_table,
|
||||||
#ifdef CONFIG_PM
|
.drv.pm = pm_sleep_ptr(&mt7663s_pm_ops),
|
||||||
.drv = {
|
|
||||||
.pm = &mt7663s_pm_ops,
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
module_sdio_driver(mt7663s_driver);
|
module_sdio_driver(mt7663s_driver);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue