Linux LED subsystem development
 help / color / mirror / Atom feed
From: Arunachalam <arun07172003@gmail.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: Andreas Werner <andreas.werner@men.de>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	Arunachalam <arun07172003@gmail.com>
Subject: [PATCH v3 4/4] leds: 88pm860x: Convert to dev_err_probe()
Date: Sat, 25 Jul 2026 13:43:49 +0530	[thread overview]
Message-ID: <20260725081349.8556-4-arun07172003@gmail.com> (raw)
In-Reply-To: <20260725081349.8556-1-arun07172003@gmail.com>

Replace open-coded dev_err() + return patterns with dev_err_probe(),
which also handles -EPROBE_DEFER correctly.

Signed-off-by: Arunachalam <arun07172003@gmail.com>
---
 drivers/leds/leds-88pm860x.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index ef5c6c466..65f2af134 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -152,16 +152,12 @@ static int pm860x_led_probe(struct platform_device *pdev)
 	if (data == NULL)
 		return -ENOMEM;
 	res = platform_get_resource_byname(pdev, IORESOURCE_REG, "control");
-	if (!res) {
-		dev_err(&pdev->dev, "No REG resource for control\n");
-		return -ENXIO;
-	}
+	if (!res)
+		return dev_err_probe(&pdev->dev, -ENXIO, "No REG resource for control\n");
 	data->reg_control = res->start;
 	res = platform_get_resource_byname(pdev, IORESOURCE_REG, "blink");
-	if (!res) {
-		dev_err(&pdev->dev, "No REG resource for blink\n");
-		return -ENXIO;
-	}
+	if (!res)
+		return dev_err_probe(&pdev->dev, -ENXIO, "No REG resource for blink\n");
 	data->reg_blink = res->start;
 	memset(data->name, 0, MFD_NAME_SIZE);
 	switch (pdev->id) {
@@ -203,10 +199,8 @@ static int pm860x_led_probe(struct platform_device *pdev)
 	mutex_init(&data->lock);
 
 	ret = led_classdev_register(chip->dev, &data->cdev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Failed to register LED: %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "Failed to register LED\n");
 	pm860x_led_set(&data->cdev, 0);
 
 	platform_set_drvdata(pdev, data);
-- 
2.39.5


  parent reply	other threads:[~2026-07-25  8:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  8:13 [PATCH v3 1/4] leds: cobalt-raq: Add missing MODULE_DESCRIPTION Arunachalam
2026-07-25  8:13 ` [PATCH v3 2/4] leds: lp8788: Convert to dev_err_probe() Arunachalam
2026-07-25  8:21   ` sashiko-bot
2026-07-25  8:13 ` [PATCH v3 3/4] leds: menf21bmc: " Arunachalam
2026-07-25  8:19   ` sashiko-bot
2026-07-25 17:51     ` [PATCH 1/2] leds: menf21bmc: Use brightness_set_blocking instead of brightness_set Arunachalam
2026-07-25  8:13 ` Arunachalam [this message]
2026-07-25  8:19   ` [PATCH v3 4/4] leds: 88pm860x: Convert to dev_err_probe() sashiko-bot
2026-07-25  8:20 ` [PATCH v3 1/4] leds: cobalt-raq: Add missing MODULE_DESCRIPTION sashiko-bot
2026-07-25 17:52   ` [PATCH 2/2] leds: cobalt-raq: Use devm_led_classdev_register() to fix use-after-unmap Arunachalam

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=20260725081349.8556-4-arun07172003@gmail.com \
    --to=arun07172003@gmail.com \
    --cc=andreas.werner@men.de \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox