On Tue, Sep 3, 2024 at 1:20 PM Marek Behún <kabel@xxxxxxxxxx> wrote: > > Use dev_err_probe() instead of dev_err() + separate return where > appropriate. ... > + if (ret) > + return dev_err_probe(dev, ret, "Cannot set LED %pOF to software mode\n", np); Side note: Not sure how np is being used besides the messaging. If it's only for the messaging, I would rather see %pfw and fwnode based approach. ... > count = of_get_available_child_count(np); > - if (!count) { > - dev_err(dev, "LEDs are not defined in device tree!\n"); > - return -ENODEV; > - } else if (count > OMNIA_BOARD_LEDS) { > - dev_err(dev, "Too many LEDs defined in device tree!\n"); > - return -EINVAL; > - } > + if (!count) Dunno if 'if (count == 0)' would look better from the readability perspective. > + return dev_err_probe(dev, -ENODEV, "LEDs are not defined in device tree!\n"); > + else if (count > OMNIA_BOARD_LEDS) Even in the original code the 'else' is redundant. > + return dev_err_probe(dev, -EINVAL, "Too many LEDs defined in device tree!\n"); -- With Best Regards, Andy Shevchenko