[PATCH 3/9] net: e1000: don't try to register eeprom if MTD support is missing

Lucas Stach l.stach at pengutronix.de
Tue Dec 20 01:33:34 PST 2016


EEPROM support is an optional feature and the driver should work
just fine without it.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/net/e1000/main.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 6f9dddaf232a..00d18adff111 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3588,10 +3588,13 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return -EINVAL;
 	}
 
-	ret = e1000_register_eeprom(hw);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "failed to register EEPROM devices!\n");
-		return ret;
+	if (IS_ENABLED(CONFIG_MTD)) {
+		ret = e1000_register_eeprom(hw);
+		if (ret < 0) {
+			dev_err(&pdev->dev,
+			        "failed to register EEPROM devices!\n");
+			return ret;
+		}
 	}
 
 	if (e1000_validate_eeprom_checksum(hw))
-- 
2.11.0




More information about the barebox mailing list