Search Linux Wireless

Re: [PATCH] iwl3945: fix up rfkill kconfig and input

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 26 June 2008, drago01 wrote:
> The attached patch fixes iwl3945 to build with CONFIG_INPUT=n and
> frees the input device on exit.
> Additionally it removes the unnecessary dependency on CONFIG_IWLCORE.
> It depends on the rfkill subsystem patch, which is in the iwlwifi-2.6 tree.
> 
> -----------------
> This patch fixes the iwl3945 driver to build with CONFIG_INPUT=n
> and remove the dependency on CONFIG_IWLCORE.
> It also frees the input device on exit.
> Input stuff based on patch from Randy Dunlap for iwl4965/5000.
> 
> Signed-off-by: Adel Gadllah <adel.gadllah@xxxxxxxxx>
> 
> diff --git a/drivers/net/wireless/iwlwifi/Kconfig
> b/drivers/net/wireless/iwlwifi/Kconfig
> index a382c00..3148a28 100644
> --- a/drivers/net/wireless/iwlwifi/Kconfig
> +++ b/drivers/net/wireless/iwlwifi/Kconfig
> @@ -105,6 +105,7 @@ config IWL3945
>  	select IWLWIFI
>  	select MAC80211_LEDS if IWL3945_LEDS
>  	select LEDS_CLASS if IWL3945_LEDS
> +	select RFKILL_INPUT if (IWL3945_RFKILL && INPUT)

That is a big no. Drivers should only use CONFIG_RFKILL and in no way
depend or select RFKILL_INPUT. RFKILL_INPUT is a decision for the user
and doesn't change anything for drivers.

See the linux-wireless thread regarding rfkill:
http://thread.gmane.org/gmane.linux.kernel.wireless.general/16653

> +#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");
> @@ -8354,6 +8355,7 @@ int iwl3945_rfkill_init(struct iwl3945_priv *priv)
>  	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

This is wrong as well, the input device for the driver has no relation whatsoever with
CONFIG_RFKILL_INPUT.

>  	ret = rfkill_register(priv->rfkill_mngr.rfkill);
>  	if (ret) {
> @@ -8361,11 +8363,13 @@ int iwl3945_rfkill_init(struct iwl3945_priv *priv)
>  		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;
>  	}
> +#endif

Same here.

>  	IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n");
>  	return ret;
> @@ -8375,8 +8379,10 @@ unregister_rfkill:
>  	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

And here.

>  freed_rfkill:
>  	if (priv->rfkill_mngr.rfkill != NULL)
> @@ -8391,13 +8397,16 @@ error:
>  void iwl3945_rfkill_unregister(struct iwl3945_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

And here.

Ivo

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux