public inbox for linux-leds@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
	David Owens <daowens01@gmail.com>
Cc: <linux-leds@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Andrew Davis <afd@ti.com>
Subject: [PATCH 2/5] leds: lp8860: Return directly from lp8860_init
Date: Thu, 5 Mar 2026 14:37:03 -0600	[thread overview]
Message-ID: <20260305203706.841384-2-afd@ti.com> (raw)
In-Reply-To: <20260305203706.841384-1-afd@ti.com>

No need to use goto to jump to a label that also just returns,
return directly in the if statements.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/leds/leds-lp8860.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index 87d298b6be7d0..71dcd55f0808f 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -216,41 +216,38 @@ static int lp8860_init(struct lp8860_led *led)
 
 	ret = lp8860_fault_check(led);
 	if (ret)
-		goto out;
+		return ret;
 
 	ret = regmap_read(led->regmap, LP8860_STATUS, &read_buf);
 	if (ret)
-		goto out;
+		return ret;
 
 	ret = lp8860_unlock_eeprom(led);
 	if (ret) {
 		dev_err(&led->client->dev, "Failed unlocking EEPROM\n");
-		goto out;
+		return ret;
 	}
 
 	reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs);
 	ret = regmap_multi_reg_write(led->regmap, lp8860_eeprom_disp_regs, reg_count);
 	if (ret) {
 		dev_err(&led->client->dev, "Failed writing EEPROM\n");
-		goto out;
+		return ret;
 	}
 
 	ret = regmap_write(led->regmap, LP8860_EEPROM_UNLOCK, LP8860_LOCK_EEPROM);
 	if (ret)
-		goto out;
+		return ret;
 
 	ret = regmap_write(led->regmap,
 			LP8860_EEPROM_CNTRL,
 			LP8860_PROGRAM_EEPROM);
 	if (ret) {
 		dev_err(&led->client->dev, "Failed programming EEPROM\n");
-		goto out;
+		return ret;
 	}
 
-	return ret;
-
-out:
-	return ret;
+	return 0;
 }
 
 static const struct regmap_range lp8860_reg_ranges[] = {
-- 
2.39.2


  reply	other threads:[~2026-03-05 20:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 20:37 [PATCH 1/5] leds: lp8860: Use a single regmap table Andrew Davis
2026-03-05 20:37 ` Andrew Davis [this message]
2026-03-05 20:37 ` [PATCH 3/5] leds: lp8860: Hold lock for all of EEPROM programming Andrew Davis
2026-03-05 20:37 ` [PATCH 4/5] leds: lp8860: Remove unused read of STATUS register Andrew Davis
2026-03-05 20:37 ` [PATCH 5/5] leds: lp8860: Do not always program EEPROM on probe Andrew Davis
2026-03-09 18:49 ` [PATCH 1/5] leds: lp8860: Use a single regmap table Lee Jones

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=20260305203706.841384-2-afd@ti.com \
    --to=afd@ti.com \
    --cc=daowens01@gmail.com \
    --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