All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markuss Broks <markuss.broks@gmail.com>
To: pavel@ucw.cz
Cc: Markuss Broks <markuss.broks@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v8 1/3] leds: ktd2692: Avoid duplicate error messages on probe deferral
Date: Thu,  5 May 2022 18:25:16 +0300	[thread overview]
Message-ID: <20220505152521.71019-2-markuss.broks@gmail.com> (raw)
In-Reply-To: <20220505152521.71019-1-markuss.broks@gmail.com>

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>
---
 drivers/leds/flash/leds-ktd2692.c | 12 ++++--------
 1 file 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))
-- 
2.35.1


  reply	other threads:[~2022-05-05 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 15:25 [PATCH v8 0/2] Make AUX gpio pin optional for ktd2692 Markuss Broks
2022-05-05 15:25 ` Markuss Broks [this message]
2022-05-05 17:29   ` [PATCH v8 1/3] leds: ktd2692: Avoid duplicate error messages on probe deferral Andy Shevchenko
2022-05-05 17:34     ` Andy Shevchenko
2022-05-07 21:14     ` Pavel Machek
2022-05-08  9:55       ` Andy Shevchenko
2022-05-05 15:25 ` [PATCH v8 2/3] dt-bindings: leds: convert ktd2692 bindings to yaml Markuss Broks
2022-05-05 15:25 ` [PATCH v8 3/3] leds: ktd2692: Make aux-gpios optional Markuss Broks
2022-05-07 21:13 ` [PATCH v8 0/2] Make AUX gpio pin optional for ktd2692 Pavel Machek
2022-05-06  5:44 [PATCH v8 1/3] leds: ktd2692: Avoid duplicate error messages on probe deferral kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220505152521.71019-2-markuss.broks@gmail.com \
    --to=markuss.broks@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.