]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: ethoc: Remove non-DM_ETH code
authorTom Rini <trini@konsulko.com>
Sun, 27 Nov 2022 15:25:11 +0000 (10:25 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 7 Dec 2022 21:04:17 +0000 (16:04 -0500)
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
include/dm/platform_data/net_ethoc.h

index a219affb58a2bd580a03e5d391719114ddeb43a0..29067e9e94948f7b0b9c20fc35e6af60d8b2beed 100644 (file)
@@ -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
index 855e9999a0a8d0f082c37913c63e310fdfbd1950..44547d14f53e6088c67b5e39a0f922e0aaddb957 100644 (file)
@@ -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 */