mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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>
This commit is contained in:
parent
28f297a7af
commit
262918d847
@ -86,7 +86,7 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static void cfg80211_leave_all(struct cfg80211_registered_device *rdev)
|
static void cfg80211_leave_all(struct cfg80211_registered_device *rdev)
|
||||||
{
|
{
|
||||||
struct wireless_dev *wdev;
|
struct wireless_dev *wdev;
|
||||||
@ -95,7 +95,7 @@ static void cfg80211_leave_all(struct cfg80211_registered_device *rdev)
|
|||||||
cfg80211_leave(rdev, wdev);
|
cfg80211_leave(rdev, wdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wiphy_suspend(struct device *dev, pm_message_t state)
|
static int wiphy_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
|
struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -136,6 +136,11 @@ static int wiphy_resume(struct device *dev)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(wiphy_pm_ops, wiphy_suspend, wiphy_resume);
|
||||||
|
#define WIPHY_PM_OPS (&wiphy_pm_ops)
|
||||||
|
#else
|
||||||
|
#define WIPHY_PM_OPS NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const void *wiphy_namespace(struct device *d)
|
static const void *wiphy_namespace(struct device *d)
|
||||||
@ -151,10 +156,7 @@ struct class ieee80211_class = {
|
|||||||
.dev_release = wiphy_dev_release,
|
.dev_release = wiphy_dev_release,
|
||||||
.dev_groups = ieee80211_groups,
|
.dev_groups = ieee80211_groups,
|
||||||
.dev_uevent = wiphy_uevent,
|
.dev_uevent = wiphy_uevent,
|
||||||
#ifdef CONFIG_PM
|
.pm = WIPHY_PM_OPS,
|
||||||
.suspend = wiphy_suspend,
|
|
||||||
.resume = wiphy_resume,
|
|
||||||
#endif
|
|
||||||
.ns_type = &net_ns_type_operations,
|
.ns_type = &net_ns_type_operations,
|
||||||
.namespace = wiphy_namespace,
|
.namespace = wiphy_namespace,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user