From 24f2dd059e29fab87c942182624fd0aae3d9591a Mon Sep 17 00:00:00 2001 From: Mahesh Mahadevan Date: Mon, 11 Sep 2023 17:14:48 -0500 Subject: [PATCH] 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 --- drivers/ethernet/eth_mcux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index a03922ccd78..b4e244ae304 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -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); }