Skip to content

Commit a9dbae7

Browse files
Joakim Tjernlunddavem330
authored andcommitted
ucc_geth: Convert to net_device_ops
Signed-off-by: David S. Miller <[email protected]>
1 parent b9d2fce commit a9dbae7

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

drivers/net/ucc_geth.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,6 +3501,20 @@ static phy_interface_t to_phy_interface(const char *phy_connection_type)
35013501
return PHY_INTERFACE_MODE_MII;
35023502
}
35033503

3504+
static const struct net_device_ops ucc_geth_netdev_ops = {
3505+
.ndo_open = ucc_geth_open,
3506+
.ndo_stop = ucc_geth_close,
3507+
.ndo_start_xmit = ucc_geth_start_xmit,
3508+
.ndo_validate_addr = eth_validate_addr,
3509+
.ndo_set_mac_address = eth_mac_addr,
3510+
.ndo_change_mtu = eth_change_mtu,
3511+
.ndo_set_multicast_list = ucc_geth_set_multi,
3512+
.ndo_tx_timeout = ucc_geth_timeout,
3513+
#ifdef CONFIG_NET_POLL_CONTROLLER
3514+
.ndo_poll_controller = ucc_netpoll,
3515+
#endif
3516+
};
3517+
35043518
static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)
35053519
{
35063520
struct device *device = &ofdev->dev;
@@ -3716,19 +3730,11 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
37163730

37173731
/* Fill in the dev structure */
37183732
uec_set_ethtool_ops(dev);
3719-
dev->open = ucc_geth_open;
3720-
dev->hard_start_xmit = ucc_geth_start_xmit;
3721-
dev->tx_timeout = ucc_geth_timeout;
3733+
dev->netdev_ops = &ucc_geth_netdev_ops;
37223734
dev->watchdog_timeo = TX_TIMEOUT;
37233735
INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
37243736
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
3725-
#ifdef CONFIG_NET_POLL_CONTROLLER
3726-
dev->poll_controller = ucc_netpoll;
3727-
#endif
3728-
dev->stop = ucc_geth_close;
3729-
// dev->change_mtu = ucc_geth_change_mtu;
37303737
dev->mtu = 1500;
3731-
dev->set_multicast_list = ucc_geth_set_multi;
37323738

37333739
ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT);
37343740
ugeth->phy_interface = phy_interface;

0 commit comments

Comments
 (0)