leds: powernv: removing NULL check
authorSaurabh Sengar <saurabh.truth@gmail.com>
Mon, 23 Nov 2015 09:28:16 +0000 (14:58 +0530)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Mon, 4 Jan 2016 08:57:38 +0000 (09:57 +0100)
No need to explicitly check for pointer to be null,
of_prop_next_string anyways returns NULL, if passed pointer is NULL
and hence loop will continue.

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/leds-powernv.c

index 1e75e1fe9b726d83b7cd8a317fce7c4c727bf82c..bc2d76e3be14ef92b3ff27c89209247e8ebef568 100644 (file)
@@ -256,8 +256,6 @@ static int powernv_led_classdev(struct platform_device *pdev,
 
        for_each_child_of_node(led_node, np) {
                p = of_find_property(np, "led-types", NULL);
-               if (!p)
-                       continue;
 
                while ((cur = of_prop_next_string(p, cur)) != NULL) {
                        powernv_led = devm_kzalloc(dev, sizeof(*powernv_led),