mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/3] e1000: mtd: remove needless error checking for device parameter
Date: Mon,  1 Jul 2024 09:35:24 +0200	[thread overview]
Message-ID: <20240701073526.176353-1-a.fatoum@pengutronix.de> (raw)

The invm device is specifically created for the EEPROM, so adding a
parameter should not result in a name clash.

This leaves only -ENOMEM as possible error. As the driver is usable
without EEPROM being writable, don't propagate the error.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/e1000/mtd.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/mtd.c b/drivers/net/e1000/mtd.c
index 50883fc2a602..b2643dcf4340 100644
--- a/drivers/net/e1000/mtd.c
+++ b/drivers/net/e1000/mtd.c
@@ -702,7 +702,6 @@ static int e1000_register_invm(struct e1000_hw *hw)
 {
 	int ret;
 	u16 word;
-	struct param_d *p;
 
 	if (e1000_eeprom_valid(hw)) {
 		ret = e1000_read_eeprom(hw, 0x0a, 1, &word);
@@ -732,15 +731,10 @@ static int e1000_register_invm(struct e1000_hw *hw)
 		return ret;
 	}
 
-	p = dev_add_param_int(&hw->invm.dev, "lock", e1000_invm_set_lock,
+	dev_add_param_int(&hw->invm.dev, "lock", e1000_invm_set_lock,
 			      NULL, &hw->invm.line, "%u", hw);
-	if (IS_ERR(p)) {
-		unregister_device(&hw->invm.dev);
-		devfs_remove(&hw->invm.cdev);
-		ret = PTR_ERR(p);
-	}
 
-	return ret;
+	return 0;
 }
 
 /*
-- 
2.39.2




             reply	other threads:[~2024-07-01  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  7:35 Ahmad Fatoum [this message]
2024-07-01  7:35 ` [PATCH 2/3] PWM: core: " Ahmad Fatoum
2024-07-01  7:35 ` [PATCH 3/3] fpga: bridge: " Ahmad Fatoum
2024-07-01  9:33 ` [PATCH 1/3] e1000: mtd: " Sascha Hauer

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=20240701073526.176353-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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