From ba50e011b142cfe739ff2c64957dbba95797a912 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 17 Apr 2020 14:37:58 +0300 Subject: [PATCH] leds: tlc591xxt: hide error on EPROBE_DEFER If devm_led_classdev_register_ext() fails with EPROBE_DEFER, we get: tlc591xx 0-0040: couldn't register LED (null) Only print the error if the error is something else than EPROBE_DEFER. Signed-off-by: Tomi Valkeinen Reviewed-by: Dan Murphy Signed-off-by: Pavel Machek --- drivers/leds/leds-tlc591xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index a8911ebd30e5..0929f1275814 100644 --- a/drivers/leds/leds-tlc591xx.c +++ b/drivers/leds/leds-tlc591xx.c @@ -214,8 +214,9 @@ tlc591xx_probe(struct i2c_client *client, err = devm_led_classdev_register_ext(dev, &led->ldev, &init_data); if (err < 0) { - dev_err(dev, "couldn't register LED %s\n", - led->ldev.name); + if (err != -EPROBE_DEFER) + dev_err(dev, "couldn't register LED %s\n", + led->ldev.name); return err; } } -- 2.39.5