leds: syscon: Correct check for syscon_node_to_regmap() errors

syscon_node_to_regmap() returns a regmap or an ERR_PTR().

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
This commit is contained in:
Bjorn Andersson 2015-08-18 12:25:26 -07:00 committed by Jacek Anaszewski
parent c2d4af9370
commit 991a3f61fa

View File

@ -83,9 +83,9 @@ static int syscon_led_probe(struct platform_device *pdev)
return -ENODEV;
}
map = syscon_node_to_regmap(parent->of_node);
if (!map) {
if (IS_ERR(map)) {
dev_err(dev, "no regmap for syscon LED parent\n");
return -ENODEV;
return PTR_ERR(map);
}
sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL);