net: e1000: Convert to driver model
Update this driver to support driver model.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Apalis T30 2GB on Apalis Evaluation Board
diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h
index da04cabd..c851922 100644
--- a/drivers/net/e1000.h
+++ b/drivers/net/e1000.h
@@ -22,7 +22,10 @@
#include <linux/list.h>
#include <malloc.h>
#include <net.h>
+/* Avoids a compile error since struct eth_device is not defined */
+#ifndef CONFIG_DM_ETH
#include <netdev.h>
+#endif
#include <asm/io.h>
#include <pci.h>
@@ -1073,7 +1076,9 @@
struct e1000_hw {
const char *name;
struct list_head list_node;
+#ifndef CONFIG_DM_ETH
struct eth_device *nic;
+#endif
#ifdef CONFIG_E1000_SPI
struct spi_slave spi;
#endif