Skip to content

Commit

Permalink
net: rfkill: Switch to PM ops
Browse files Browse the repository at this point in the history
Use dev_pm_ops instead of the legacy suspend/resume callbacks for the
rfkill class suspend and resume operations.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
larsclausen authored and jmberg-intel committed May 20, 2015
1 parent 94c78cb commit 28f297a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ void rfkill_resume_polling(struct rfkill *rfkill)
}
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);

Expand All @@ -818,13 +819,18 @@ static int rfkill_resume(struct device *dev)
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 = {
.name = "rfkill",
.dev_release = rfkill_release,
.dev_groups = rfkill_dev_groups,
.dev_uevent = rfkill_dev_uevent,
.suspend = rfkill_suspend,
.resume = rfkill_resume,
.pm = RFKILL_PM_OPS,
};

bool rfkill_blocked(struct rfkill *rfkill)
Expand Down

0 comments on commit 28f297a

Please sign in to comment.