summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-tlc591xx.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-26 17:50:13 +0300
committerPavel Machek <pavel@ucw.cz>2020-09-09 12:20:10 +0300
commit03eb2ca44a95105d1482d5e7471016cf8b383f97 (patch)
treea03fe53ad24ab65ae8dde4267edd0f15ff300d37 /drivers/leds/leds-tlc591xx.c
parent4582e783a2f481a813aa61178d77b2a5cb8f1d9e (diff)
downloadlinux-03eb2ca44a95105d1482d5e7471016cf8b383f97.tar.xz
leds: tlc591xx: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-tlc591xx.c')
-rw-r--r--drivers/leds/leds-tlc591xx.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
index 0929f1275814..1dc14051639c 100644
--- a/drivers/leds/leds-tlc591xx.c
+++ b/drivers/leds/leds-tlc591xx.c
@@ -213,12 +213,10 @@ tlc591xx_probe(struct i2c_client *client,
led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
err = devm_led_classdev_register_ext(dev, &led->ldev,
&init_data);
- if (err < 0) {
- if (err != -EPROBE_DEFER)
- dev_err(dev, "couldn't register LED %s\n",
- led->ldev.name);
- return err;
- }
+ if (err < 0)
+ return dev_err_probe(dev, err,
+ "couldn't register LED %s\n",
+ led->ldev.name);
}
return 0;
}