Commit 28f297a7 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Johannes Berg

net: rfkill: Switch to PM ops

Use dev_pm_ops instead of the legacy suspend/resume callbacks for the
rfkill class suspend and resume operations.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 94c78cb4
...@@ -794,7 +794,8 @@ void rfkill_resume_polling(struct rfkill *rfkill) ...@@ -794,7 +794,8 @@ void rfkill_resume_polling(struct rfkill *rfkill)
} }
EXPORT_SYMBOL(rfkill_resume_polling); EXPORT_SYMBOL(rfkill_resume_polling);
static int rfkill_suspend(struct device *dev, pm_message_t state) #ifdef CONFIG_PM_SLEEP
static int rfkill_suspend(struct device *dev)
{ {
struct rfkill *rfkill = to_rfkill(dev); struct rfkill *rfkill = to_rfkill(dev);
...@@ -818,13 +819,18 @@ static int rfkill_resume(struct device *dev) ...@@ -818,13 +819,18 @@ static int rfkill_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(rfkill_pm_ops, rfkill_suspend, rfkill_resume);
#define RFKILL_PM_OPS (&rfkill_pm_ops)
#else
#define RFKILL_PM_OPS NULL
#endif
static struct class rfkill_class = { static struct class rfkill_class = {
.name = "rfkill", .name = "rfkill",
.dev_release = rfkill_release, .dev_release = rfkill_release,
.dev_groups = rfkill_dev_groups, .dev_groups = rfkill_dev_groups,
.dev_uevent = rfkill_dev_uevent, .dev_uevent = rfkill_dev_uevent,
.suspend = rfkill_suspend, .pm = RFKILL_PM_OPS,
.resume = rfkill_resume,
}; };
bool rfkill_blocked(struct rfkill *rfkill) bool rfkill_blocked(struct rfkill *rfkill)
......
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