[PATCH 16/41] net: ethoc: Remove non-DM_ETH code

Tom Rini
2022-11-27T15:28:29Z

As DM_ETH is required for all network drivers, it's now safe to
remove the non-DM_ETH support code.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
drivers/net/ethoc.c | 85 ----------------------------
include/dm/platform_data/net_ethoc.h | 4 --
2 files changed, 89 deletions(-)

diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index a219affb58a2..29067e9e9494 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -643,8 +643,6 @@ static inline int ethoc_phy_init(struct ethoc *priv, void *dev)

#endif

-#ifdef CONFIG_DM_ETH
-
static int ethoc_write_hwaddr(struct udevice *dev)
{
struct ethoc_eth_pdata *pdata = dev_get_plat(dev);
@@ -753,86 +751,3 @@ U_BOOT_DRIVER(ethoc) = {
.priv_auto = sizeof(struct ethoc),
.plat_auto = sizeof(struct ethoc_eth_pdata),
};
-
-#else
-
-static int ethoc_init(struct eth_device *dev, struct bd_info *bd)
-{
- struct ethoc *priv = (struct ethoc *)dev->priv;
-
- return ethoc_init_common(priv);
-}
-
-static int ethoc_write_hwaddr(struct eth_device *dev)
-{
- struct ethoc *priv = (struct ethoc *)dev->priv;
- u8 *mac = dev->enetaddr;
-
- return ethoc_write_hwaddr_common(priv, mac);
-}
-
-static int ethoc_send(struct eth_device *dev, void *packet, int length)
-{
- return ethoc_send_common(dev->priv, packet, length);
-}
-
-static void ethoc_halt(struct eth_device *dev)
-{
- ethoc_disable_rx_and_tx(dev->priv);
-}
-
-static int ethoc_recv(struct eth_device *dev)
-{
- struct ethoc *priv = (struct ethoc *)dev->priv;
- int count;
-
- if (!ethoc_is_new_packet_received(priv))
- return 0;
-
- for (count = 0; count < PKTBUFSRX; ++count) {
- uchar *packetp;
- int size = ethoc_rx_common(priv, &packetp);
-
- if (size < 0)
- break;
- if (size > 0)
- net_process_received_packet(packetp, size);
- ethoc_free_pkt_common(priv);
- }
- return 0;
-}
-
-int ethoc_initialize(u8 dev_num, int base_addr)
-{
- struct ethoc *priv;
- struct eth_device *dev;
-
- priv = malloc(sizeof(*priv));
- if (!priv)
- return 0;
- dev = malloc(sizeof(*dev));
- if (!dev) {
- free(priv);
- return 0;
- }
-
- memset(dev, 0, sizeof(*dev));
- dev->priv = priv;
- dev->iobase = base_addr;
- dev->init = ethoc_init;
- dev->halt = ethoc_halt;
- dev->send = ethoc_send;
- dev->recv = ethoc_recv;
- dev->write_hwaddr = ethoc_write_hwaddr;
- sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
- priv->iobase = ioremap(dev->iobase, ETHOC_IOSIZE);
-
- eth_register(dev);
-
- ethoc_mdio_init(dev->name, priv);
- ethoc_phy_init(priv, dev);
-
- return 1;
-}
-
-#endif
diff --git a/include/dm/platform_data/net_ethoc.h b/include/dm/platform_data/net_ethoc.h
index 855e9999a0a8..44547d14f53e 100644
--- a/include/dm/platform_data/net_ethoc.h
+++ b/include/dm/platform_data/net_ethoc.h
@@ -8,13 +8,9 @@

#include <net.h>

-#ifdef CONFIG_DM_ETH
-
struct ethoc_eth_pdata {
struct eth_pdata eth_pdata;
phys_addr_t packet_base;
};

-#endif
-
#endif /* _ETHOC_H */
--
2.25.1