drivers: usb: uhc: fix unused variable warning for phy_config

Remove phy_config local variable then use controller-specific
config struct for usb PHY initialization

Signed-off-by: Aiden Hu <weiwei.hu@nxp.com>
This commit is contained in:
Aiden Hu
2025-12-16 14:15:34 +08:00
committed by Fabio Baltieri
parent 7a1cc72efa
commit 1cbc2de20f
2 changed files with 12 additions and 14 deletions

View File

@@ -92,8 +92,7 @@ static usb_status_t mcux_host_callback(usb_device_handle deviceHandle,
static int uhc_mcux_init(const struct device *dev)
{
const struct uhc_mcux_config *config = dev->config;
usb_phy_config_struct_t *phy_config;
const struct uhc_mcux_ehci_config *config = dev->config;
struct uhc_mcux_data *priv = uhc_get_private(dev);
k_thread_entry_t thread_entry = NULL;
usb_status_t status;
@@ -108,9 +107,8 @@ static int uhc_mcux_init(const struct device *dev)
}
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
phy_config = ((const struct uhc_mcux_ehci_config *)dev->config)->phy_config;
if (phy_config != NULL) {
USB_EhciPhyInit(priv->controller_id, 0u, phy_config);
if (config->phy_config != NULL) {
USB_EhciPhyInit(priv->controller_id, 0u, config->phy_config);
}
#endif
@@ -124,8 +122,9 @@ static int uhc_mcux_init(const struct device *dev)
}
/* Create MCUX USB host driver task */
k_thread_create(&priv->drv_stack_data, config->drv_stack, CONFIG_UHC_NXP_THREAD_STACK_SIZE,
thread_entry, (void *)dev, NULL, NULL, K_PRIO_COOP(2), 0, K_NO_WAIT);
k_thread_create(&priv->drv_stack_data, config->uhc_config.drv_stack,
CONFIG_UHC_NXP_THREAD_STACK_SIZE, thread_entry,
(void *)dev, NULL, NULL, K_PRIO_COOP(2), 0, K_NO_WAIT);
k_thread_name_set(&priv->drv_stack_data, "uhc_mcux_ehci");
return 0;

View File

@@ -67,8 +67,7 @@ static usb_status_t mcux_host_callback(usb_device_handle deviceHandle,
static int uhc_mcux_init(const struct device *dev)
{
const struct uhc_mcux_config *config = dev->config;
usb_phy_config_struct_t *phy_config;
const struct uhc_mcux_ip3516hs_config *config = dev->config;
struct uhc_mcux_data *priv = uhc_get_private(dev);
k_thread_entry_t thread_entry = NULL;
usb_status_t status;
@@ -83,9 +82,8 @@ static int uhc_mcux_init(const struct device *dev)
}
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
phy_config = ((const struct uhc_mcux_ip3516hs_config *)dev->config)->phy_config;
if (phy_config != NULL) {
USB_EhciPhyInit(priv->controller_id, 0u, phy_config);
if (config->phy_config != NULL) {
USB_EhciPhyInit(priv->controller_id, 0u, config->phy_config);
}
#endif
@@ -99,8 +97,9 @@ static int uhc_mcux_init(const struct device *dev)
}
/* Create MCUX USB host driver task */
k_thread_create(&priv->drv_stack_data, config->drv_stack, CONFIG_UHC_NXP_THREAD_STACK_SIZE,
thread_entry, (void *)dev, NULL, NULL, K_PRIO_COOP(2), 0, K_NO_WAIT);
k_thread_create(&priv->drv_stack_data, config->uhc_config.drv_stack,
CONFIG_UHC_NXP_THREAD_STACK_SIZE, thread_entry,
(void *)dev, NULL, NULL, K_PRIO_COOP(2), 0, K_NO_WAIT);
k_thread_name_set(&priv->drv_stack_data, "uhc_mcux_ip3516hs");
return 0;