提交 a571ea4e 编写于 作者: T Tomas Winkler 提交者: John W. Linville

iwlwifi: LED initialize before registering

This patch initialize all fields in led before registering it
This fixes oops on initialization
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c4f55232
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册