diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-03-28 19:21:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-01 17:13:19 -0400 |
commit | a571ea4eb34adbf33bbaf4bdc6db6037b1a93e0f (patch) | |
tree | b05601f835961c682a07334d1e3e836c0cbae188 /drivers | |
parent | c4f552321fa2cfe1d6b1846138d2aa8254308f96 (diff) |
iwlwifi: LED initialize before registering
This patch initialize all fields in led before registering it
This fixes oops on initialization
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-led.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c index d59ad1844e25..4fe5ee2ba545 100644 --- a/drivers/net/wireless/iwlwifi/iwl-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-led.c | |||
@@ -238,18 +238,20 @@ static int iwl_leds_register_led(struct iwl_priv *priv, | |||
238 | led->led_dev.brightness_set = iwl4965_led_brightness_set; | 238 | led->led_dev.brightness_set = iwl4965_led_brightness_set; |
239 | led->led_dev.default_trigger = trigger; | 239 | led->led_dev.default_trigger = trigger; |
240 | 240 | ||
241 | led->priv = priv; | ||
242 | led->type = type; | ||
243 | |||
241 | ret = led_classdev_register(device, &led->led_dev); | 244 | ret = led_classdev_register(device, &led->led_dev); |
242 | if (ret) { | 245 | if (ret) { |
243 | IWL_ERROR("Error: failed to register led handler.\n"); | 246 | IWL_ERROR("Error: failed to register led handler.\n"); |
244 | return ret; | 247 | return ret; |
245 | } | 248 | } |
246 | 249 | ||
247 | led->priv = priv; | ||
248 | led->type = type; | ||
249 | led->registered = 1; | 250 | led->registered = 1; |
250 | 251 | ||
251 | if (set_led && led->led_on) | 252 | if (set_led && led->led_on) |
252 | led->led_on(priv, IWL_LED_LINK); | 253 | led->led_on(priv, IWL_LED_LINK); |
254 | |||
253 | return 0; | 255 | return 0; |
254 | } | 256 | } |
255 | 257 | ||