aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-26 08:42:10 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-08-20 08:13:44 -0400
commitc0af07340aae5db9f976bfe71e2e9bcab3169409 (patch)
tree519b17d2fa5700b2b32f12b67926981228029bda /net/mac80211/main.c
parent9b8648704358e42f9865cd6de7cedb5ac0db67e7 (diff)
mac80211: convert ops checks to WARN_ON
There's no need to BUG_ON when a driver registers invalid operations, warn and return an error. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e706f9e5b051..bd7529363193 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -545,6 +545,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
545 int priv_size, i; 545 int priv_size, i;
546 struct wiphy *wiphy; 546 struct wiphy *wiphy;
547 547
548 if (WARN_ON(!ops->tx || !ops->start || !ops->stop || !ops->config ||
549 !ops->add_interface || !ops->remove_interface ||
550 !ops->configure_filter))
551 return NULL;
552
548 if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove))) 553 if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
549 return NULL; 554 return NULL;
550 555
@@ -597,13 +602,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
597 602
598 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); 603 local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN);
599 604
600 BUG_ON(!ops->tx);
601 BUG_ON(!ops->start);
602 BUG_ON(!ops->stop);
603 BUG_ON(!ops->config);
604 BUG_ON(!ops->add_interface);
605 BUG_ON(!ops->remove_interface);
606 BUG_ON(!ops->configure_filter);
607 local->ops = ops; 605 local->ops = ops;
608 606
609 /* set up some defaults */ 607 /* set up some defaults */