]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/wireless/core.c
Merge tag 'hwlock-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson...
[linux.git] / net / wireless / core.c
index 32b3c719fdfce2487321d29a10b03c0cebad17f8..350513744575a4387d283f3533c23a3f746e999f 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2006-2010         Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
  * Copyright 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018 Intel Corporation
+ * Copyright (C) 2018-2019 Intel Corporation
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -142,12 +142,10 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
        if (result)
                return result;
 
-       if (rdev->wiphy.debugfsdir &&
-           !debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
-                           rdev->wiphy.debugfsdir,
-                           rdev->wiphy.debugfsdir->d_parent,
-                           newname))
-               pr_err("failed to rename debugfs dir to %s!\n", newname);
+       if (rdev->wiphy.debugfsdir)
+               debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
+                              rdev->wiphy.debugfsdir,
+                              rdev->wiphy.debugfsdir->d_parent, newname);
 
        nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
 
@@ -302,12 +300,13 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
        return 0;
 }
 
-static void cfg80211_rfkill_sync_work(struct work_struct *work)
+static void cfg80211_rfkill_block_work(struct work_struct *work)
 {
        struct cfg80211_registered_device *rdev;
 
-       rdev = container_of(work, struct cfg80211_registered_device, rfkill_sync);
-       cfg80211_rfkill_set_block(rdev, rfkill_blocked(rdev->rfkill));
+       rdev = container_of(work, struct cfg80211_registered_device,
+                           rfkill_block);
+       cfg80211_rfkill_set_block(rdev, true);
 }
 
 static void cfg80211_event_work(struct work_struct *work)
@@ -518,7 +517,7 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
                return NULL;
        }
 
-       INIT_WORK(&rdev->rfkill_sync, cfg80211_rfkill_sync_work);
+       INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
        INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
        INIT_WORK(&rdev->event_work, cfg80211_event_work);
 
@@ -899,11 +898,8 @@ int wiphy_register(struct wiphy *wiphy)
        cfg80211_rdev_list_generation++;
 
        /* add to debugfs */
-       rdev->wiphy.debugfsdir =
-               debugfs_create_dir(wiphy_name(&rdev->wiphy),
-                                  ieee80211_debugfs_dir);
-       if (IS_ERR(rdev->wiphy.debugfsdir))
-               rdev->wiphy.debugfsdir = NULL;
+       rdev->wiphy.debugfsdir = debugfs_create_dir(wiphy_name(&rdev->wiphy),
+                                                   ieee80211_debugfs_dir);
 
        cfg80211_debugfs_rdev_add(rdev);
        nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
@@ -1066,7 +1062,7 @@ void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked)
        struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
 
        if (rfkill_set_hw_state(rdev->rfkill, blocked))
-               schedule_work(&rdev->rfkill_sync);
+               schedule_work(&rdev->rfkill_block);
 }
 EXPORT_SYMBOL(wiphy_rfkill_set_hw_state);