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@xxxxxxxxxxxxxx> --- 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