stm32: SocketCAN: allow non-late netdev initialization

This commit is contained in:
JacobCrabill 2022-04-10 11:33:11 -07:00 committed by Mateusz Szafoni
parent b6d9eab7c9
commit 0a37bd8d4f
2 changed files with 50 additions and 0 deletions

View File

@ -2461,3 +2461,28 @@ int stm32_cansockinitialize(int port)
errout: errout:
return ret; return ret;
} }
/****************************************************************************
* Name: arm_netinitialize
*
* Description:
* Initialize the CAN device interfaces. If there is more than one device
* interface in the chip, then board-specific logic will have to provide
* this function to determine which, if any, CAN interfaces should be
* initialized.
*
****************************************************************************/
#if !defined(CONFIG_NETDEV_LATEINIT)
void arm_netinitialize(void)
{
#ifdef CONFIG_STM32_CAN1
stm32_cansockinitialize(0);
#endif
#ifdef CONFIG_STM32_CAN2
stm32_cansockinitialize(1);
#endif
}
#endif

View File

@ -3293,3 +3293,28 @@ int stm32_fdcansockinitialize(int port)
errout: errout:
return ret; return ret;
} }
/****************************************************************************
* Name: arm_netinitialize
*
* Description:
* Initialize the CAN device interfaces. If there is more than one device
* interface in the chip, then board-specific logic will have to provide
* this function to determine which, if any, CAN interfaces should be
* initialized.
*
****************************************************************************/
#if !defined(CONFIG_NETDEV_LATEINIT)
void arm_netinitialize(void)
{
#ifdef CONFIG_STM32_CAN1
stm32_fdcansockinitialize(0);
#endif
#ifdef CONFIG_STM32_CAN2
stm32_fdcansockinitialize(1);
#endif
}
#endif