diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-05-16 08:35:54 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-05-20 09:00:12 -0400 |
commit | 262918d847c0f66a0ec05db9de7571ed72e422af (patch) | |
tree | 26fef07a6bcdbfb74df296a161e2ae5d26874253 | |
parent | 28f297a7af7e00500d72e6c0421c7e10ec96f627 (diff) |
cfg80211: Switch to PM ops
Use dev_pm_ops instead of the legacy suspend/resume callbacks for the wiphy
class suspend and resume operations.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/wireless/sysfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index 9ee6bc1a7610..9cee0220665d 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c | |||
@@ -86,7 +86,7 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
86 | return 0; | 86 | return 0; |
87 | } | 87 | } |
88 | 88 | ||
89 | #ifdef CONFIG_PM | 89 | #ifdef CONFIG_PM_SLEEP |
90 | static void cfg80211_leave_all(struct cfg80211_registered_device *rdev) | 90 | static void cfg80211_leave_all(struct cfg80211_registered_device *rdev) |
91 | { | 91 | { |
92 | struct wireless_dev *wdev; | 92 | struct wireless_dev *wdev; |
@@ -95,7 +95,7 @@ static void cfg80211_leave_all(struct cfg80211_registered_device *rdev) | |||
95 | cfg80211_leave(rdev, wdev); | 95 | cfg80211_leave(rdev, wdev); |
96 | } | 96 | } |
97 | 97 | ||
98 | static int wiphy_suspend(struct device *dev, pm_message_t state) | 98 | static int wiphy_suspend(struct device *dev) |
99 | { | 99 | { |
100 | struct cfg80211_registered_device *rdev = dev_to_rdev(dev); | 100 | struct cfg80211_registered_device *rdev = dev_to_rdev(dev); |
101 | int ret = 0; | 101 | int ret = 0; |
@@ -136,6 +136,11 @@ static int wiphy_resume(struct device *dev) | |||
136 | 136 | ||
137 | return ret; | 137 | return ret; |
138 | } | 138 | } |
139 | |||
140 | static SIMPLE_DEV_PM_OPS(wiphy_pm_ops, wiphy_suspend, wiphy_resume); | ||
141 | #define WIPHY_PM_OPS (&wiphy_pm_ops) | ||
142 | #else | ||
143 | #define WIPHY_PM_OPS NULL | ||
139 | #endif | 144 | #endif |
140 | 145 | ||
141 | static const void *wiphy_namespace(struct device *d) | 146 | static const void *wiphy_namespace(struct device *d) |
@@ -151,10 +156,7 @@ struct class ieee80211_class = { | |||
151 | .dev_release = wiphy_dev_release, | 156 | .dev_release = wiphy_dev_release, |
152 | .dev_groups = ieee80211_groups, | 157 | .dev_groups = ieee80211_groups, |
153 | .dev_uevent = wiphy_uevent, | 158 | .dev_uevent = wiphy_uevent, |
154 | #ifdef CONFIG_PM | 159 | .pm = WIPHY_PM_OPS, |
155 | .suspend = wiphy_suspend, | ||
156 | .resume = wiphy_resume, | ||
157 | #endif | ||
158 | .ns_type = &net_ns_type_operations, | 160 | .ns_type = &net_ns_type_operations, |
159 | .namespace = wiphy_namespace, | 161 | .namespace = wiphy_namespace, |
160 | }; | 162 | }; |