On 17/07/2019 17:15, Jean-Jacques Hiblot wrote:
+struct led_classdev *__must_check devm_led_get(struct device *dev, + int index) +{ + struct led_classdev *led; + struct led_classdev **dr; +
Should you check here if dev->of_node == NULL? Or should of_led_get() check it.
+ led = of_led_get(dev->of_node, index); + if (IS_ERR(led)) + return led; + + dr = devres_alloc(devm_led_release, sizeof(struct led_classdev *), + GFP_KERNEL); + if (!dr) { + led_put(led); + return ERR_PTR(-ENOMEM); + } + + *dr = led; + devres_add(dev, dr); + + return led; +}
Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel