From a1aecd736994fe13b88c5db41c2f4e64bdc91d9c Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Thu, 23 Mar 2023 13:37:17 +0100 Subject: [PATCH] {stm32/stm32l4/stm32f7/stm32h7/efm32}/otgdev: remove invalid use of the priv field for EP This field is for use in the class driver, not in the controller logic --- arch/arm/src/efm32/efm32_usbdev.c | 7 ++----- arch/arm/src/stm32/stm32_otgfsdev.c | 7 ++----- arch/arm/src/stm32/stm32_otghsdev.c | 7 ++----- arch/arm/src/stm32f7/stm32_otgdev.c | 7 ++----- arch/arm/src/stm32h7/stm32_otgdev.c | 7 ++----- arch/arm/src/stm32l4/stm32l4_otgfsdev.c | 7 ++----- 6 files changed, 12 insertions(+), 30 deletions(-) diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index 55581f4a84..958d397372 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -1526,8 +1526,8 @@ static inline void efm32_ep0out_receive(struct efm32_ep_s *privep, /* Sanity Checking */ - DEBUGASSERT(privep && privep->ep.priv); - priv = (struct efm32_usbdev_s *)privep->ep.priv; + DEBUGASSERT(privep && privep->dev); + priv = (struct efm32_usbdev_s *)privep->dev; uinfo("EP0: bcnt=%d\n", bcnt); usbtrace(TRACE_READ(EP0), bcnt); @@ -5149,9 +5149,6 @@ static void efm32_swinitialize(struct efm32_usbdev_s *priv) priv->epavail[0] = EFM32_EP_AVAILABLE; priv->epavail[1] = EFM32_EP_AVAILABLE; - priv->epin[EP0].ep.priv = priv; - priv->epout[EP0].ep.priv = priv; - /* Initialize the endpoint lists */ for (i = 0; i < EFM32_NENDPOINTS; i++) diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 5ad1ba2e32..8b53d27755 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -1571,8 +1571,8 @@ static inline void stm32_ep0out_receive(struct stm32_ep_s *privep, /* Sanity Checking */ - DEBUGASSERT(privep && privep->ep.priv); - priv = (struct stm32_usbdev_s *)privep->ep.priv; + DEBUGASSERT(privep && privep->dev); + priv = (struct stm32_usbdev_s *)privep->dev; uinfo("EP0: bcnt=%d\n", bcnt); usbtrace(TRACE_READ(EP0), bcnt); @@ -5234,9 +5234,6 @@ static void stm32_swinitialize(struct stm32_usbdev_s *priv) priv->epavail[0] = STM32_EP_AVAILABLE; priv->epavail[1] = STM32_EP_AVAILABLE; - priv->epin[EP0].ep.priv = priv; - priv->epout[EP0].ep.priv = priv; - /* Initialize the endpoint lists */ for (i = 0; i < STM32_NENDPOINTS; i++) diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index 6a7e7c0b89..d99bd2f643 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -1520,8 +1520,8 @@ static inline void stm32_ep0out_receive(struct stm32_ep_s *privep, /* Sanity Checking */ - DEBUGASSERT(privep && privep->ep.priv); - priv = (struct stm32_usbdev_s *)privep->ep.priv; + DEBUGASSERT(privep && privep->dev); + priv = (struct stm32_usbdev_s *)privep->dev; uinfo("EP0: bcnt=%d\n", bcnt); usbtrace(TRACE_READ(EP0), bcnt); @@ -5138,9 +5138,6 @@ static void stm32_swinitialize(struct stm32_usbdev_s *priv) priv->epavail[0] = STM32_EP_AVAILABLE; priv->epavail[1] = STM32_EP_AVAILABLE; - priv->epin[EP0].ep.priv = priv; - priv->epout[EP0].ep.priv = priv; - /* Initialize the endpoint lists */ for (i = 0; i < STM32_NENDPOINTS; i++) diff --git a/arch/arm/src/stm32f7/stm32_otgdev.c b/arch/arm/src/stm32f7/stm32_otgdev.c index eb20e86f69..93ed4b5ff6 100644 --- a/arch/arm/src/stm32f7/stm32_otgdev.c +++ b/arch/arm/src/stm32f7/stm32_otgdev.c @@ -1628,8 +1628,8 @@ static inline void stm32_ep0out_receive(struct stm32_ep_s *privep, /* Sanity Checking */ - DEBUGASSERT(privep && privep->ep.priv); - priv = (struct stm32_usbdev_s *)privep->ep.priv; + DEBUGASSERT(privep && privep->dev); + priv = (struct stm32_usbdev_s *)privep->dev; uinfo("EP0: bcnt=%d\n", bcnt); usbtrace(TRACE_READ(EP0), bcnt); @@ -5250,9 +5250,6 @@ static void stm32_swinitialize(struct stm32_usbdev_s *priv) priv->epavail[0] = STM32_EP_AVAILABLE; priv->epavail[1] = STM32_EP_AVAILABLE; - priv->epin[EP0].ep.priv = priv; - priv->epout[EP0].ep.priv = priv; - /* Initialize the endpoint lists */ for (i = 0; i < STM32_NENDPOINTS; i++) diff --git a/arch/arm/src/stm32h7/stm32_otgdev.c b/arch/arm/src/stm32h7/stm32_otgdev.c index 66e4e3632e..23f394f5af 100644 --- a/arch/arm/src/stm32h7/stm32_otgdev.c +++ b/arch/arm/src/stm32h7/stm32_otgdev.c @@ -1582,8 +1582,8 @@ static inline void stm32_ep0out_receive(struct stm32_ep_s *privep, /* Sanity Checking */ - DEBUGASSERT(privep && privep->ep.priv); - priv = (struct stm32_usbdev_s *)privep->ep.priv; + DEBUGASSERT(privep && privep->dev); + priv = (struct stm32_usbdev_s *)privep->dev; uinfo("EP0: bcnt=%d\n", bcnt); usbtrace(TRACE_READ(EP0), bcnt); @@ -5163,9 +5163,6 @@ static void stm32_swinitialize(struct stm32_usbdev_s *priv) priv->epavail[0] = STM32_EP_AVAILABLE; priv->epavail[1] = STM32_EP_AVAILABLE; - priv->epin[EP0].ep.priv = priv; - priv->epout[EP0].ep.priv = priv; - /* Initialize the endpoint lists */ for (i = 0; i < STM32_NENDPOINTS; i++) diff --git a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c index b2164fadee..4e8983612b 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c @@ -1634,8 +1634,8 @@ static inline void stm32l4_ep0out_receive(struct stm32l4_ep_s *privep, /* Sanity Checking */ - DEBUGASSERT(privep && privep->ep.priv); - priv = (struct stm32l4_usbdev_s *)privep->ep.priv; + DEBUGASSERT(privep && privep->dev); + priv = (struct stm32l4_usbdev_s *)privep->dev; uinfo("EP0: bcnt=%d\n", bcnt); usbtrace(TRACE_READ(EP0), bcnt); @@ -5287,9 +5287,6 @@ static void stm32l4_swinitialize(struct stm32l4_usbdev_s *priv) priv->epavail[0] = STM32L4_EP_AVAILABLE; priv->epavail[1] = STM32L4_EP_AVAILABLE; - priv->epin[EP0].ep.priv = priv; - priv->epout[EP0].ep.priv = priv; - /* Initialize the IN endpoint list */ for (i = 0; i < STM32L4_NENDPOINTS; i++)