[LL][RNG] Add ERROR status use case to API LL_RNG_DeInit()
diff --git a/Src/stm32l4xx_ll_rng.c b/Src/stm32l4xx_ll_rng.c index 2d7dabf..7ae8a02 100644 --- a/Src/stm32l4xx_ll_rng.c +++ b/Src/stm32l4xx_ll_rng.c
@@ -85,14 +85,24 @@ */ ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx) { + ErrorStatus status = SUCCESS; + /* Check the parameters */ assert_param(IS_RNG_ALL_INSTANCE(RNGx)); - /* Enable RNG reset state */ - LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG); + if (RNGx == RNG) + { + /* Enable RNG reset state */ + LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG); - /* Release RNG from reset state */ - LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG); - return (SUCCESS); + /* Release RNG from reset state */ + LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG); + } + else + { + status = ERROR; + } + + return status; } #if defined(RNG_CR_CED)