提交 d735d25e 编写于 作者: F Fabio Estevam 提交者: Rafael J. Wysocki

leds: leds-gpio: Fix the "default-state" property check

Commit a43f2cbb ("leds: leds-gpio: Make use of device property API")
caused a regression by reading the incorrect string for the "default-state"
property.

Fix the property string check to restore the original behaviour.

Fixes: a43f2cbb (leds: leds-gpio: Make use of device property API)
Reported-by: NJean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Acked-by: NBryan Wu <cooloney@gmail.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 29470ea8
......@@ -203,7 +203,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
fwnode_property_read_string(child, "linux,default-trigger",
&led.default_trigger);
if (!fwnode_property_read_string(child, "linux,default_state",
if (!fwnode_property_read_string(child, "default-state",
&state)) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册