drivers: usb: device: resolve USB build error for STM32N6

- Removing the unused declaration of 'ret'
  in the usb_dc_stm32_init function for STM32N6.
- Ensuring the 'ret' variable is used correctly
  in the pinctrl_apply_state function call.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
This commit is contained in:
IBEN EL HADJ MESSAOUD Marwa 2025-04-15 14:56:58 +02:00 committed by Benjamin Cabé
commit 60835568fc

View file

@ -459,7 +459,6 @@ static int usb_dc_stm32_clock_disable(void)
static int usb_dc_stm32_init(void) static int usb_dc_stm32_init(void)
{ {
HAL_StatusTypeDef status; HAL_StatusTypeDef status;
int ret;
unsigned int i; unsigned int i;
usb_dc_stm32_state.pcd.Init.speed = usb_dc_stm32_state.pcd.Init.speed =
@ -521,7 +520,7 @@ static int usb_dc_stm32_init(void)
#if !DT_HAS_COMPAT_STATUS_OKAY(st_stm32n6_otghs) #if !DT_HAS_COMPAT_STATUS_OKAY(st_stm32n6_otghs)
LOG_DBG("Pinctrl signals configuration"); LOG_DBG("Pinctrl signals configuration");
ret = pinctrl_apply_state(usb_pcfg, PINCTRL_STATE_DEFAULT); int ret = pinctrl_apply_state(usb_pcfg, PINCTRL_STATE_DEFAULT);
if (ret < 0) { if (ret < 0) {
LOG_ERR("USB pinctrl setup failed (%d)", ret); LOG_ERR("USB pinctrl setup failed (%d)", ret);
return ret; return ret;