diff options
author | Markuss Broks <markuss.broks@gmail.com> | 2022-05-05 18:25:16 +0300 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2022-05-07 23:12:18 +0200 |
commit | 1d3b5aaaa41088770ae31feb075ca07893d2c898 (patch) | |
tree | 5d6c19cb2c7fba3f20b88e9d4270a96778ed4be4 /drivers/leds | |
parent | e1347bd4abfb3eaee8bbdc9089b64b249a7639b6 (diff) | |
download | linux-1d3b5aaaa41088770ae31feb075ca07893d2c898.tar.gz linux-1d3b5aaaa41088770ae31feb075ca07893d2c898.tar.bz2 linux-1d3b5aaaa41088770ae31feb075ca07893d2c898.zip |
leds: ktd2692: Avoid duplicate error messages on probe deferral
Use dev_err_probe instead of dev_err to avoid duplicate error
messages if the GPIO allocation makes the probe defer.
Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/flash/leds-ktd2692.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/leds/flash/leds-ktd2692.c b/drivers/leds/flash/leds-ktd2692.c index ed1f20a58bf6..8b99742cb68a 100644 --- a/drivers/leds/flash/leds-ktd2692.c +++ b/drivers/leds/flash/leds-ktd2692.c @@ -279,17 +279,13 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev, led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS); ret = PTR_ERR_OR_ZERO(led->ctrl_gpio); - if (ret) { - dev_err(dev, "cannot get ctrl-gpios %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n"); led->aux_gpio = devm_gpiod_get(dev, "aux", GPIOD_ASIS); ret = PTR_ERR_OR_ZERO(led->aux_gpio); - if (ret) { - dev_err(dev, "cannot get aux-gpios %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, PTR_ERR(led->aux_gpio), "cannot get aux-gpios\n"); led->regulator = devm_regulator_get(dev, "vin"); if (IS_ERR(led->regulator)) |