diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2008-06-25 00:02:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-27 09:09:20 -0400 |
commit | b973e42eb25036a2672db7f7749f6989ab10479c (patch) | |
tree | 4ed0332089e7ddffe5ce4ff958a03e98c10c606f /drivers/net | |
parent | 428da76523e4a9c08bdfadc25a05b520f19b9133 (diff) |
iwlwifi: fix build for CONFIG_INPUT=n
Fix iwlwifi so that it builds cleanly with CONFIG_INPUT=n.
Also free the input device on exit.
drivers/built-in.o: In function `iwl_rfkill_unregister':
(.text+0xbf430): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `iwl_rfkill_init':
(.text+0xbf51c): undefined reference to `input_allocate_device'
drivers/built-in.o: In function `iwl_rfkill_init':
(.text+0xbf5bf): undefined reference to `input_register_device'
drivers/built-in.o: In function `iwl_rfkill_init':
(.text+0xbf5e9): undefined reference to `input_free_device'
net/built-in.o: In function `rfkill_disconnect':
rfkill-input.c:(.text+0xe71e1): undefined reference to `input_close_device'
rfkill-input.c:(.text+0xe71e9): undefined reference to `input_unregister_handle'
net/built-in.o: In function `rfkill_connect':
rfkill-input.c:(.text+0xe723e): undefined reference to `input_register_handle'
rfkill-input.c:(.text+0xe724d): undefined reference to `input_open_device'
rfkill-input.c:(.text+0xe725c): undefined reference to `input_unregister_handle'
net/built-in.o: In function `rfkill_handler_init':
rfkill-input.c:(.init.text+0x36ec): undefined reference to `input_register_handler'
net/built-in.o: In function `rfkill_handler_exit':
rfkill-input.c:(.exit.text+0x112c): undefined reference to `input_unregister_handler'
make[1]: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rfkill.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig index a382c0078923..d7ea32f39694 100644 --- a/drivers/net/wireless/iwlwifi/Kconfig +++ b/drivers/net/wireless/iwlwifi/Kconfig | |||
@@ -8,7 +8,7 @@ config IWLCORE | |||
8 | select MAC80211_LEDS if IWLWIFI_LEDS | 8 | select MAC80211_LEDS if IWLWIFI_LEDS |
9 | select LEDS_CLASS if IWLWIFI_LEDS | 9 | select LEDS_CLASS if IWLWIFI_LEDS |
10 | select RFKILL if IWLWIFI_RFKILL | 10 | select RFKILL if IWLWIFI_RFKILL |
11 | select RFKILL_INPUT if IWLWIFI_RFKILL | 11 | select RFKILL_INPUT if (IWLWIFI_RFKILL && INPUT) |
12 | 12 | ||
13 | config IWLWIFI_LEDS | 13 | config IWLWIFI_LEDS |
14 | bool | 14 | bool |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c index 5f098747cf95..4624ac7b4980 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c +++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c | |||
@@ -95,6 +95,7 @@ int iwl_rfkill_init(struct iwl_priv *priv) | |||
95 | priv->rfkill_mngr.rfkill->dev.class->suspend = NULL; | 95 | priv->rfkill_mngr.rfkill->dev.class->suspend = NULL; |
96 | priv->rfkill_mngr.rfkill->dev.class->resume = NULL; | 96 | priv->rfkill_mngr.rfkill->dev.class->resume = NULL; |
97 | 97 | ||
98 | #if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE) | ||
98 | priv->rfkill_mngr.input_dev = input_allocate_device(); | 99 | priv->rfkill_mngr.input_dev = input_allocate_device(); |
99 | if (!priv->rfkill_mngr.input_dev) { | 100 | if (!priv->rfkill_mngr.input_dev) { |
100 | IWL_ERROR("Unable to allocate rfkill input device.\n"); | 101 | IWL_ERROR("Unable to allocate rfkill input device.\n"); |
@@ -109,6 +110,7 @@ int iwl_rfkill_init(struct iwl_priv *priv) | |||
109 | priv->rfkill_mngr.input_dev->dev.parent = device; | 110 | priv->rfkill_mngr.input_dev->dev.parent = device; |
110 | priv->rfkill_mngr.input_dev->evbit[0] = BIT(EV_KEY); | 111 | priv->rfkill_mngr.input_dev->evbit[0] = BIT(EV_KEY); |
111 | set_bit(KEY_WLAN, priv->rfkill_mngr.input_dev->keybit); | 112 | set_bit(KEY_WLAN, priv->rfkill_mngr.input_dev->keybit); |
113 | #endif | ||
112 | 114 | ||
113 | ret = rfkill_register(priv->rfkill_mngr.rfkill); | 115 | ret = rfkill_register(priv->rfkill_mngr.rfkill); |
114 | if (ret) { | 116 | if (ret) { |
@@ -116,11 +118,13 @@ int iwl_rfkill_init(struct iwl_priv *priv) | |||
116 | goto free_input_dev; | 118 | goto free_input_dev; |
117 | } | 119 | } |
118 | 120 | ||
121 | #if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE) | ||
119 | ret = input_register_device(priv->rfkill_mngr.input_dev); | 122 | ret = input_register_device(priv->rfkill_mngr.input_dev); |
120 | if (ret) { | 123 | if (ret) { |
121 | IWL_ERROR("Unable to register rfkill input device: %d\n", ret); | 124 | IWL_ERROR("Unable to register rfkill input device: %d\n", ret); |
122 | goto unregister_rfkill; | 125 | goto unregister_rfkill; |
123 | } | 126 | } |
127 | #endif | ||
124 | 128 | ||
125 | IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n"); | 129 | IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n"); |
126 | return ret; | 130 | return ret; |
@@ -130,8 +134,10 @@ unregister_rfkill: | |||
130 | priv->rfkill_mngr.rfkill = NULL; | 134 | priv->rfkill_mngr.rfkill = NULL; |
131 | 135 | ||
132 | free_input_dev: | 136 | free_input_dev: |
137 | #if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE) | ||
133 | input_free_device(priv->rfkill_mngr.input_dev); | 138 | input_free_device(priv->rfkill_mngr.input_dev); |
134 | priv->rfkill_mngr.input_dev = NULL; | 139 | priv->rfkill_mngr.input_dev = NULL; |
140 | #endif | ||
135 | 141 | ||
136 | freed_rfkill: | 142 | freed_rfkill: |
137 | if (priv->rfkill_mngr.rfkill != NULL) | 143 | if (priv->rfkill_mngr.rfkill != NULL) |
@@ -147,13 +153,16 @@ EXPORT_SYMBOL(iwl_rfkill_init); | |||
147 | void iwl_rfkill_unregister(struct iwl_priv *priv) | 153 | void iwl_rfkill_unregister(struct iwl_priv *priv) |
148 | { | 154 | { |
149 | 155 | ||
156 | #if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE) | ||
150 | if (priv->rfkill_mngr.input_dev) | 157 | if (priv->rfkill_mngr.input_dev) |
151 | input_unregister_device(priv->rfkill_mngr.input_dev); | 158 | input_unregister_device(priv->rfkill_mngr.input_dev); |
159 | input_free_device(priv->rfkill_mngr.input_dev); | ||
160 | priv->rfkill_mngr.input_dev = NULL; | ||
161 | #endif | ||
152 | 162 | ||
153 | if (priv->rfkill_mngr.rfkill) | 163 | if (priv->rfkill_mngr.rfkill) |
154 | rfkill_unregister(priv->rfkill_mngr.rfkill); | 164 | rfkill_unregister(priv->rfkill_mngr.rfkill); |
155 | 165 | ||
156 | priv->rfkill_mngr.input_dev = NULL; | ||
157 | priv->rfkill_mngr.rfkill = NULL; | 166 | priv->rfkill_mngr.rfkill = NULL; |
158 | } | 167 | } |
159 | EXPORT_SYMBOL(iwl_rfkill_unregister); | 168 | EXPORT_SYMBOL(iwl_rfkill_unregister); |