]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: wilc1000: Fold wilc_create_wiphy() into cfg80211.c
authorMarek Vasut <marex@denx.de>
Fri, 4 Oct 2024 11:44:14 +0000 (13:44 +0200)
committerKalle Valo <kvalo@kernel.org>
Thu, 17 Oct 2024 16:47:42 +0000 (19:47 +0300)
The wilc_create_wiphy() is not used outside of cfg80211.c .
Make the function static and remove its entry from cfg80211.h

Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241004114551.40236-5-marex@denx.de
drivers/net/wireless/microchip/wilc1000/cfg80211.c
drivers/net/wireless/microchip/wilc1000/cfg80211.h

index eb37b228d54ea0edc20cdd4a24964d4e3d76941b..11e0f8a473467ec6efb76b6097786853545f78b2 100644 (file)
@@ -1757,53 +1757,7 @@ void wlan_deinit_locks(struct wilc *wilc)
        cleanup_srcu_struct(&wilc->srcu);
 }
 
-int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
-                      const struct wilc_hif_func *ops)
-{
-       struct wilc *wl;
-       int ret, i;
-
-       wl = wilc_create_wiphy(dev);
-       if (!wl)
-               return -EINVAL;
-
-       wlan_init_locks(wl);
-
-       ret = wilc_wlan_cfg_init(wl);
-       if (ret)
-               goto free_wl;
-
-       *wilc = wl;
-       wl->io_type = io_type;
-       wl->hif_func = ops;
-
-       for (i = 0; i < NQUEUES; i++)
-               INIT_LIST_HEAD(&wl->txq[i].txq_head.list);
-
-       INIT_LIST_HEAD(&wl->rxq_head.list);
-       INIT_LIST_HEAD(&wl->vif_list);
-
-       wl->hif_workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
-                                                   wiphy_name(wl->wiphy));
-       if (!wl->hif_workqueue) {
-               ret = -ENOMEM;
-               goto free_cfg;
-       }
-
-       return 0;
-
-free_cfg:
-       wilc_wlan_cfg_deinit(wl);
-
-free_wl:
-       wlan_deinit_locks(wl);
-       wiphy_unregister(wl->wiphy);
-       wiphy_free(wl->wiphy);
-       return ret;
-}
-EXPORT_SYMBOL_GPL(wilc_cfg80211_init);
-
-struct wilc *wilc_create_wiphy(struct device *dev)
+static struct wilc *wilc_create_wiphy(struct device *dev)
 {
        struct wiphy *wiphy;
        struct wilc *wl;
@@ -1861,6 +1815,52 @@ struct wilc *wilc_create_wiphy(struct device *dev)
        return wl;
 }
 
+int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
+                      const struct wilc_hif_func *ops)
+{
+       struct wilc *wl;
+       int ret, i;
+
+       wl = wilc_create_wiphy(dev);
+       if (!wl)
+               return -EINVAL;
+
+       wlan_init_locks(wl);
+
+       ret = wilc_wlan_cfg_init(wl);
+       if (ret)
+               goto free_wl;
+
+       *wilc = wl;
+       wl->io_type = io_type;
+       wl->hif_func = ops;
+
+       for (i = 0; i < NQUEUES; i++)
+               INIT_LIST_HEAD(&wl->txq[i].txq_head.list);
+
+       INIT_LIST_HEAD(&wl->rxq_head.list);
+       INIT_LIST_HEAD(&wl->vif_list);
+
+       wl->hif_workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                                   wiphy_name(wl->wiphy));
+       if (!wl->hif_workqueue) {
+               ret = -ENOMEM;
+               goto free_cfg;
+       }
+
+       return 0;
+
+free_cfg:
+       wilc_wlan_cfg_deinit(wl);
+
+free_wl:
+       wlan_deinit_locks(wl);
+       wiphy_unregister(wl->wiphy);
+       wiphy_free(wl->wiphy);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(wilc_cfg80211_init);
+
 int wilc_init_host_int(struct net_device *net)
 {
        int ret;
index 8c65951cfaf9640db1195fcf710730ece303aec9..fc04cc6615c1fa4567d3c314ad628e2194b98780 100644 (file)
@@ -10,7 +10,6 @@
 
 int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
                       const struct wilc_hif_func *ops);
-struct wilc *wilc_create_wiphy(struct device *dev);
 void wilc_deinit_host_int(struct net_device *net);
 int wilc_init_host_int(struct net_device *net);
 void wilc_wfi_monitor_rx(struct net_device *mon_dev, u8 *buff, u32 size);