2011-05-05 23:48:49

by Larry Finger

[permalink] [raw]
Subject: [PATCH] mac80211: Fix build error when CONFIG_PM is not defined

When mac80211 is built without CONFIG_PM being defined, the following errors
are output:

net/mac80211/main.c: In function ‘ieee80211_register_hw’:
net/mac80211/main.c:700: error: ‘const struct ieee80211_ops’ has no member named ‘suspend’
net/mac80211/main.c:700: error: ‘const struct ieee80211_ops’ has no member named ‘resume’
make[2]: *** [net/mac80211/main.o] Error 1
make[1]: *** [net/mac80211] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [net] Error 2

Signed-off-by: Larry Finger <[email protected]>
---

Index: wireless-testing/net/mac80211/main.c
===================================================================
--- wireless-testing.orig/net/mac80211/main.c
+++ wireless-testing/net/mac80211/main.c
@@ -696,8 +696,11 @@ int ieee80211_register_hw(struct ieee802
WLAN_CIPHER_SUITE_AES_CMAC
};

- if ((hw->wiphy->wowlan.flags || hw->wiphy->wowlan.n_patterns) &&
- (!local->ops->suspend || !local->ops->resume))
+ if ((hw->wiphy->wowlan.flags || hw->wiphy->wowlan.n_patterns)
+#ifdef CONFIG_PM
+ && (!local->ops->suspend || !local->ops->resume)
+#endif
+ )
return -EINVAL;

if (hw->max_report_rates == 0)


2011-05-06 08:20:23

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Fix build error when CONFIG_PM is not defined

On Thu, 2011-05-05 at 18:48 -0500, Larry Finger wrote:
> When mac80211 is built without CONFIG_PM being defined, the following errors
> are output:
>
> net/mac80211/main.c: In function ‘ieee80211_register_hw’:
> net/mac80211/main.c:700: error: ‘const struct ieee80211_ops’ has no member named ‘suspend’
> net/mac80211/main.c:700: error: ‘const struct ieee80211_ops’ has no member named ‘resume’
> make[2]: *** [net/mac80211/main.o] Error 1
> make[1]: *** [net/mac80211] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [net] Error 2

Oh, what a stupid mistake, thanks!

johannes