X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fe1000.c;h=875682b1b89e1ee31b7226e646be3c108b850933;hb=db37cc9c3954d5e33b218e5635e7e08ff902e3f6;hp=196989b3864f9b709f571e83e4959fef25e31eb0;hpb=595af9db2422fa5ae734cfe615415b17a5098f34;p=oweals%2Fu-boot.git diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 196989b386..875682b1b8 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -1522,11 +1522,10 @@ e1000_initialize_hardware_bits(struct e1000_hw *hw) reg_txdctl1 |= E1000_TXDCTL_COUNT_DESC; E1000_WRITE_REG(hw, TXDCTL1, reg_txdctl1); - /* IGB is cool */ - if (hw->mac_type == e1000_igb) - return; switch (hw->mac_type) { + case e1000_igb: /* IGB is cool */ + return; case e1000_82571: case e1000_82572: /* Clear PHY TX compatible mode bits */ @@ -5513,7 +5512,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 +5549,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);