mirror of
https://github.com/torvalds/linux.git
synced 2024-12-19 17:41:29 +00:00
iwlwifi: fix rfkill deps and remove input device usage
This patch fixes the rfkill deps for iwl4965/5000 and removes the input device usage. Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
ae6a44e3af
commit
245727c180
@ -8,7 +8,6 @@ config IWLCORE
|
|||||||
select MAC80211_LEDS if IWLWIFI_LEDS
|
select MAC80211_LEDS if IWLWIFI_LEDS
|
||||||
select LEDS_CLASS if IWLWIFI_LEDS
|
select LEDS_CLASS if IWLWIFI_LEDS
|
||||||
select RFKILL if IWLWIFI_RFKILL
|
select RFKILL if IWLWIFI_RFKILL
|
||||||
select RFKILL_INPUT if (IWLWIFI_RFKILL && INPUT)
|
|
||||||
|
|
||||||
config IWLWIFI_LEDS
|
config IWLWIFI_LEDS
|
||||||
bool
|
bool
|
||||||
|
@ -98,36 +98,11 @@ int iwl_rfkill_init(struct iwl_priv *priv)
|
|||||||
priv->rfkill_mngr.rfkill->dev.class->suspend = NULL;
|
priv->rfkill_mngr.rfkill->dev.class->suspend = NULL;
|
||||||
priv->rfkill_mngr.rfkill->dev.class->resume = NULL;
|
priv->rfkill_mngr.rfkill->dev.class->resume = NULL;
|
||||||
|
|
||||||
#if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE)
|
|
||||||
priv->rfkill_mngr.input_dev = input_allocate_device();
|
|
||||||
if (!priv->rfkill_mngr.input_dev) {
|
|
||||||
IWL_ERROR("Unable to allocate rfkill input device.\n");
|
|
||||||
ret = -ENOMEM;
|
|
||||||
goto freed_rfkill;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->rfkill_mngr.input_dev->name = priv->cfg->name;
|
|
||||||
priv->rfkill_mngr.input_dev->phys = wiphy_name(priv->hw->wiphy);
|
|
||||||
priv->rfkill_mngr.input_dev->id.bustype = BUS_HOST;
|
|
||||||
priv->rfkill_mngr.input_dev->id.vendor = priv->pci_dev->vendor;
|
|
||||||
priv->rfkill_mngr.input_dev->dev.parent = device;
|
|
||||||
priv->rfkill_mngr.input_dev->evbit[0] = BIT(EV_KEY);
|
|
||||||
set_bit(KEY_WLAN, priv->rfkill_mngr.input_dev->keybit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = rfkill_register(priv->rfkill_mngr.rfkill);
|
ret = rfkill_register(priv->rfkill_mngr.rfkill);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
IWL_ERROR("Unable to register rfkill: %d\n", ret);
|
IWL_ERROR("Unable to register rfkill: %d\n", ret);
|
||||||
goto free_input_dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE)
|
|
||||||
ret = input_register_device(priv->rfkill_mngr.input_dev);
|
|
||||||
if (ret) {
|
|
||||||
IWL_ERROR("Unable to register rfkill input device: %d\n", ret);
|
|
||||||
goto unregister_rfkill;
|
goto unregister_rfkill;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n");
|
IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -136,12 +111,6 @@ unregister_rfkill:
|
|||||||
rfkill_unregister(priv->rfkill_mngr.rfkill);
|
rfkill_unregister(priv->rfkill_mngr.rfkill);
|
||||||
priv->rfkill_mngr.rfkill = NULL;
|
priv->rfkill_mngr.rfkill = NULL;
|
||||||
|
|
||||||
free_input_dev:
|
|
||||||
#if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE)
|
|
||||||
input_free_device(priv->rfkill_mngr.input_dev);
|
|
||||||
priv->rfkill_mngr.input_dev = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
freed_rfkill:
|
freed_rfkill:
|
||||||
if (priv->rfkill_mngr.rfkill != NULL)
|
if (priv->rfkill_mngr.rfkill != NULL)
|
||||||
rfkill_free(priv->rfkill_mngr.rfkill);
|
rfkill_free(priv->rfkill_mngr.rfkill);
|
||||||
@ -156,13 +125,6 @@ EXPORT_SYMBOL(iwl_rfkill_init);
|
|||||||
void iwl_rfkill_unregister(struct iwl_priv *priv)
|
void iwl_rfkill_unregister(struct iwl_priv *priv)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined(CONFIG_RFKILL_INPUT) || defined(CONFIG_RFKILL_INPUT_MODULE)
|
|
||||||
if (priv->rfkill_mngr.input_dev)
|
|
||||||
input_unregister_device(priv->rfkill_mngr.input_dev);
|
|
||||||
input_free_device(priv->rfkill_mngr.input_dev);
|
|
||||||
priv->rfkill_mngr.input_dev = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (priv->rfkill_mngr.rfkill)
|
if (priv->rfkill_mngr.rfkill)
|
||||||
rfkill_unregister(priv->rfkill_mngr.rfkill);
|
rfkill_unregister(priv->rfkill_mngr.rfkill);
|
||||||
|
|
||||||
@ -173,7 +135,6 @@ EXPORT_SYMBOL(iwl_rfkill_unregister);
|
|||||||
/* set rf-kill to the right state. */
|
/* set rf-kill to the right state. */
|
||||||
void iwl_rfkill_set_hw_state(struct iwl_priv *priv)
|
void iwl_rfkill_set_hw_state(struct iwl_priv *priv)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!priv->rfkill_mngr.rfkill)
|
if (!priv->rfkill_mngr.rfkill)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -31,12 +31,10 @@
|
|||||||
struct iwl_priv;
|
struct iwl_priv;
|
||||||
|
|
||||||
#include <linux/rfkill.h>
|
#include <linux/rfkill.h>
|
||||||
#include <linux/input.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_IWLWIFI_RFKILL
|
#ifdef CONFIG_IWLWIFI_RFKILL
|
||||||
struct iwl_rfkill_mngr {
|
struct iwl_rfkill_mngr {
|
||||||
struct rfkill *rfkill;
|
struct rfkill *rfkill;
|
||||||
struct input_dev *input_dev;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void iwl_rfkill_set_hw_state(struct iwl_priv *priv);
|
void iwl_rfkill_set_hw_state(struct iwl_priv *priv);
|
||||||
|
Loading…
Reference in New Issue
Block a user