From eb4e8ceb4787ffaba4c2ff3b34978138b25ec248 Mon Sep 17 00:00:00 2001 From: Alban Bedel Date: Wed, 3 Aug 2016 11:31:03 +0200 Subject: net: e1000: Fix the build with driver model and SPI EEPROM When adding support for the driver model the SPI EEPROM feature had been ignored. Fix the build with both CONFIG_DM_ETH and CONFIG_E1000_SPI enabled. Signed-off-by: Alban Bedel Acked-by: Joe Hershberger --- drivers/net/e1000.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/net/e1000.c') diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 196989b386..3332ad95d4 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -5513,7 +5513,8 @@ static int do_e1000(cmd_tbl_t *cmdtp, int flag, struct udevice *dev; char name[30]; int ret; -#else +#endif +#if !defined(CONFIG_DM_ETH) || defined(CONFIG_E1000_SPI) struct e1000_hw *hw; #endif int cardnum; @@ -5549,6 +5550,9 @@ static int do_e1000(cmd_tbl_t *cmdtp, int flag, } #ifdef CONFIG_E1000_SPI +#ifdef CONFIG_DM_ETH + hw = dev_get_priv(dev); +#endif /* Handle the "SPI" subcommand */ if (!strcmp(argv[2], "spi")) return do_e1000_spi(cmdtp, hw, argc - 3, argv + 3); -- cgit v1.2.3