leds: syscon: Correct check for syscon_node_to_regmap() errors
authorBjorn Andersson <bjorn.andersson@sonymobile.com>
Tue, 18 Aug 2015 19:25:26 +0000 (12:25 -0700)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Fri, 28 Aug 2015 12:06:25 +0000 (14:06 +0200)
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>
drivers/leds/leds-syscon.c

index d1660b0398125943b58822401d350b9ce983d5f2..b88900d721e4494e9e05c494e7d9977501cda97b 100644 (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);