MLK-17362-04 bcmdhd: fix build warning for .reg_notifier callback
authorFugang Duan <fugang.duan@nxp.com>
Thu, 11 Jan 2018 09:08:54 +0000 (17:08 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:53:08 +0000 (14:53 -0500)
drivers/net/wireless/bcmdhd/wl_cfg80211.c: In function 'wl_setup_wiphy':
drivers/net/wireless/bcmdhd/wl_cfg80211.c:8253:28: warning: assignment from incompatible pointer type
  wdev->wiphy->reg_notifier = wl_cfg80211_reg_notifier;

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
drivers/net/wireless/bcmdhd/wl_cfg80211.c

index e041dcb..4ae767f 100644 (file)
@@ -534,7 +534,11 @@ wl_cfg80211_add_iw_ie(struct bcm_cfg80211 *cfg, struct net_device *ndev, s32 bss
 static s32 wl_setup_wiphy(struct wireless_dev *wdev, struct device *dev, void *data);
 static void wl_free_wdev(struct bcm_cfg80211 *cfg);
 #ifdef CONFIG_CFG80211_INTERNAL_REGDB
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
 static int
+#else
+static void
+#endif /* kernel version < 3.10.11 */
 wl_cfg80211_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
 #endif /* CONFIG_CFG80211_INTERNAL_REGDB */
 
@@ -8074,7 +8078,11 @@ s32 wl_mode_to_nl80211_iftype(s32 mode)
 }
 
 #ifdef CONFIG_CFG80211_INTERNAL_REGDB
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
 static int
+#else
+static void
+#endif /* kernel version < 3.9.0 */
 wl_cfg80211_reg_notifier(
        struct wiphy *wiphy,
        struct regulatory_request *request)
@@ -8084,7 +8092,11 @@ wl_cfg80211_reg_notifier(
 
        if (!request || !cfg) {
                WL_ERR(("Invalid arg\n"));
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
                return -EINVAL;
+#else
+               return;
+#endif /* kernel version < 3.9.0 */
        }
 
        WL_DBG(("ccode: %c%c Initiator: %d\n",
@@ -8109,7 +8121,11 @@ wl_cfg80211_reg_notifier(
                WL_ERR(("set country Failed :%d\n", ret));
        }
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
        return ret;
+#else
+       return;
+#endif /* kernel version < 3.9.0 */
 }
 #endif /* CONFIG_CFG80211_INTERNAL_REGDB */