On 12/25/25 11:41 AM, Alice Guo (OSS) wrote:

Hello Alice,

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index cfaf49d67f0..03ff4ce10d5 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -280,7 +280,12 @@ static void ehci_mx6_powerup_fixup(struct ehci_ctrl
*ctrl, uint32_t *status_reg,
   /* Should be done in the MXS PHY driver */
   static void usb_oc_config(struct usbnc_regs *usbnc, int index)
   {
+#if defined(CONFIG_MX6)
        void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl[index]);
+#elif defined(CONFIG_USB_EHCI_MX7) || defined(CONFIG_MX7ULP) ||
defined(CONFIG_IMX8) || \
+      defined(CONFIG_IMX8ULP)
+       void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl[0]); #endif
Can we simply pass 0 to this function as index for non-MX6 instead of this
ifdeffery ?

Even if I move the condition from inside the usb_oc_config() to the call site, 
I still cannot avoid conditional compilation because the logic is 
platform-specific.
Given this, is it acceptable to keep the current change as it is?
Can we please somehow weed out the ifdeffery ?

Reply via email to