All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: drago01 <drago01@gmail.com>
Cc: "Linux Wireless" <linux-wireless@vger.kernel.org>,
	"Zhu, Yi" <yi.zhu@intel.com>,
	randy.dunlap@oracle.com,
	"John W. Linville" <linville@tuxdriver.com>,
	"Abhijeet Kolekar" <abhijeet.kolekar@intel.com>
Subject: Re: [PATCH] iwl3945: fix up rfkill kconfig and input
Date: Fri, 27 Jun 2008 00:15:00 +0200	[thread overview]
Message-ID: <200806270015.00301.IvDoorn@gmail.com> (raw)
In-Reply-To: <f6ca9fed0806261455j17848d17pa011ae47246a32@mail.gmail.com>

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@gmail.com>
> 
> 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


  reply	other threads:[~2008-06-26 22:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 21:55 [PATCH] iwl3945: fix up rfkill kconfig and input drago01
2008-06-26 22:15 ` Ivo van Doorn [this message]
2008-06-26 22:27   ` [PATCH v2] " drago01
2008-06-26 22:45     ` Ivo van Doorn
2008-06-26 22:56       ` Randy Dunlap
2008-06-27  9:21         ` Zhu Yi
2008-06-27 10:47           ` Fabien Crespel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200806270015.00301.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=abhijeet.kolekar@intel.com \
    --cc=drago01@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=randy.dunlap@oracle.com \
    --cc=yi.zhu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.