From: Tomas Winkler Date: Fri, 28 Mar 2008 23:21:11 +0000 (-0700) Subject: iwlwifi: LED initialize before registering X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a571ea4eb34adbf33bbaf4bdc6db6037b1a93e0f;p=linux-beck.git 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 Signed-off-by: Reinette Chatre Signed-off-by: John W. Linville --- 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, led->led_dev.brightness_set = iwl4965_led_brightness_set; led->led_dev.default_trigger = trigger; + led->priv = priv; + led->type = type; + ret = led_classdev_register(device, &led->led_dev); if (ret) { IWL_ERROR("Error: failed to register led handler.\n"); return ret; } - led->priv = priv; - led->type = type; led->registered = 1; if (set_led && led->led_on) led->led_on(priv, IWL_LED_LINK); + return 0; }