Commit 991a3f61 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Jacek Anaszewski

leds: syscon: Correct check for syscon_node_to_regmap() errors

syscon_node_to_regmap() returns a regmap or an ERR_PTR().
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
parent c2d4af93
...@@ -83,9 +83,9 @@ static int syscon_led_probe(struct platform_device *pdev) ...@@ -83,9 +83,9 @@ static int syscon_led_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
map = syscon_node_to_regmap(parent->of_node); map = syscon_node_to_regmap(parent->of_node);
if (!map) { if (IS_ERR(map)) {
dev_err(dev, "no regmap for syscon LED parent\n"); dev_err(dev, "no regmap for syscon LED parent\n");
return -ENODEV; return PTR_ERR(map);
} }
sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL); sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment