9
0
Fork 0

net: e1000: don't try to register eeprom if MTD support is missing

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

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2016-12-20 10:33:34 +01:00 committed by Sascha Hauer
parent a86f9ca824
commit e9be2ee4cb
1 changed files with 7 additions and 4 deletions

View File

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