drivers: eth_mcux: Avoid using deprecated SDK function

The SDK function ENET_SetCallback is deprecated and has
been removed in the latest SDK.
Update the driver to set the callback during Init by using
the callback config param.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
Mahesh Mahadevan 2023-09-11 17:14:48 -05:00 committed by David Leach
commit 24f2dd059e

View file

@ -1042,6 +1042,8 @@ static void eth_mcux_init(const struct device *dev)
enet_config.interrupt |= kENET_MiiInterrupt;
#endif
enet_config.miiMode = kENET_RmiiMode;
enet_config.callback = eth_callback;
enet_config.userData = context;
if (IS_ENABLED(CONFIG_ETH_MCUX_PROMISCUOUS_MODE)) {
enet_config.macSpecialConfig |= kENET_ControlPromiscuousEnable;
@ -1098,7 +1100,6 @@ static void eth_mcux_init(const struct device *dev)
/* Enable reclaim of tx descriptors that will have the tx timestamp */
ENET_SetTxReclaim(&context->enet_handle, true, 0);
#endif
ENET_SetCallback(&context->enet_handle, eth_callback, context);
eth_mcux_phy_start(context);
}